Revert "fix: append chat messages instead of re-rendering entire game"
This reverts commit 6976b773bd.
This commit is contained in:
@@ -172,13 +172,8 @@ func HandleSnakeEvents(snakeStore *snake.SnakeStore, nc *nats.Conn, sm *scs.Sess
|
||||
if msg == nil {
|
||||
continue
|
||||
}
|
||||
chatMsg, _ := room.Receive(msg.Data)
|
||||
err := sse.PatchElementTempl(
|
||||
chatcomponents.ChatMessage(chatMsg, chatCfg),
|
||||
datastar.WithSelectorID("snake-chat-history"),
|
||||
datastar.WithModeAppend(),
|
||||
)
|
||||
if err != nil {
|
||||
room.Receive(msg.Data)
|
||||
if err := patchAll(); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user