This commit is contained in:
Alexei Anoshenko 2026-05-23 12:19:07 +03:00
parent 620a81ae1b
commit ebed7a209d
2 changed files with 11 additions and 6 deletions

View File

@ -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)

View File

@ -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