Problem: WebSocket wouldn't connect on page load because Pinia auth state doesn't automatically transfer from SSR to client hydration. The auth store showed isAuthenticated=false on client mount. Solution: - useWebSocket.onMounted now proactively calls checkAuth() if not authenticated - This ensures auth state is initialized before attempting WebSocket connection - Added forceReconnect() function to clear stale singleton connections Debug UI (temporary): - Added connection status debug info to loading overlay and banner - Shows Auth/Connected/Connecting/Error states - Retry button triggers auth check + reconnect 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| CLAUDE.md | ||
| useGameActions.ts | ||
| useWebSocket.ts | ||