fix: remove broken connection indicator
The ConnectionIndicator component caused PatchElementsNoTargetsFound errors due to complex nested IDs. Removing it for now - we can design a better solution later if needed.
This commit is contained in:
@@ -12,7 +12,6 @@ import (
|
||||
|
||||
"github.com/ryanhamamura/games/chat"
|
||||
chatcomponents "github.com/ryanhamamura/games/chat/components"
|
||||
sharedcomponents "github.com/ryanhamamura/games/features/common/components"
|
||||
"github.com/ryanhamamura/games/features/snakegame/pages"
|
||||
"github.com/ryanhamamura/games/features/snakegame/services"
|
||||
"github.com/ryanhamamura/games/sessions"
|
||||
@@ -118,10 +117,7 @@ func HandleSnakeEvents(snakeStore *snake.SnakeStore, svc *services.GameService,
|
||||
return sse.PatchElementTempl(pages.GameContent(sg, mySlot, chatMessages(), chatCfg, gameID))
|
||||
}
|
||||
|
||||
// Send initial connection indicator and render
|
||||
if err := sse.PatchElementTempl(sharedcomponents.ConnectionIndicator(time.Now().UnixMilli())); err != nil {
|
||||
return
|
||||
}
|
||||
// Send initial render
|
||||
if err := patchAll(); err != nil {
|
||||
return
|
||||
}
|
||||
@@ -145,10 +141,7 @@ func HandleSnakeEvents(snakeStore *snake.SnakeStore, svc *services.GameService,
|
||||
return
|
||||
|
||||
case <-heartbeat.C:
|
||||
// Heartbeat updates connection indicator and refreshes game state
|
||||
if err := sse.PatchElementTempl(sharedcomponents.ConnectionIndicator(time.Now().UnixMilli())); err != nil {
|
||||
return
|
||||
}
|
||||
// Heartbeat refreshes game state to keep connection alive
|
||||
if err := patchAll(); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -37,7 +37,6 @@ templ GamePage(sg *snake.SnakeGame, mySlot int, messages []chat.Message, chatCfg
|
||||
data-on:keydown__throttle.100ms={ keydownScript(gameID) }
|
||||
tabindex="0"
|
||||
>
|
||||
@components.ConnectionIndicator(0)
|
||||
@GameContent(sg, mySlot, messages, chatCfg, gameID)
|
||||
</main>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user