diff --git a/animation.go b/animation.go index c98775e..bc86f87 100644 --- a/animation.go +++ b/animation.go @@ -776,7 +776,8 @@ func (animation *animationData) writeAnimationString(tag PropertyName, buffer *s if value := animation.Get(tag); value != nil { text := propertyValueToString(tag, value, indent2) if text != "" { - buffer.WriteString("\n" + indent2) + buffer.WriteRune('\n') + buffer.WriteString(indent2) buffer.WriteString(string(tag)) buffer.WriteString(" = ") buffer.WriteString(text) @@ -814,7 +815,8 @@ func (animation *animationData) writeAnimationString(tag PropertyName, buffer *s } if props, ok := animation.Get(PropertyTag).([]AnimatedProperty); ok && props != nil && len(props) > 0 { - buffer.WriteString("\n" + indent2) + buffer.WriteRune('\n') + buffer.WriteString(indent2) buffer.WriteString(string(PropertyTag)) buffer.WriteString(" = ") if len(props) > 1 { @@ -824,13 +826,15 @@ func (animation *animationData) writeAnimationString(tag PropertyName, buffer *s writeProperty(prop, indent2+"\t") buffer.WriteString("\n") } - buffer.WriteString(indent2 + "],") + buffer.WriteString(indent2) + buffer.WriteString("],") } else { writeProperty(props[0], indent2) } } buffer.WriteRune('\n') - buffer.WriteString(indent + "},\n") + buffer.WriteString(indent) + buffer.WriteString("},\n") } writeAnimation(animation, buffer, indent) diff --git a/appWasm.go b/appWasm.go index 045e787..ed3add1 100644 --- a/appWasm.go +++ b/appWasm.go @@ -45,7 +45,7 @@ func (app *wasmApp) handleMessage(this js.Value, args []js.Value) any { if ProtocolInDebugLog { DebugLog(text) } - if obj := ParseDataText(text); obj != nil { + if obj, _ := ParseDataText(text); obj != nil { switch command := obj.Tag(); command { case "session-close": app.close <- obj @@ -64,7 +64,8 @@ func (app *wasmApp) removeSession(id int) { } func (app *wasmApp) createSession() Session { - session := newSession(app, 0, "", ParseDataText(js.Global().Call("sessionInfo", "").String())) + obj, _ := ParseDataText(js.Global().Call("sessionInfo", "").String()) + session := newSession(app, 0, "", obj) session.setBridge(app.close, app.bridge) session.setContent(app.createContentFunc(session)) return session