fix: cursor not showing on game start

Issue: When game starts, renderBoard() rebuilds DOM which removes cursor class
Solution: Add gameStatus as dependency to useCursorRender
- Now re-applies cursor after board renders
- Only applies cursor when gameStatus === 'started'

This ensures cursor is visible immediately when game starts at position (0,0).
This commit is contained in:
2025-10-22 18:56:44 +01:00
parent b635c21042
commit 6d12a01f21
2 changed files with 10 additions and 3 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ export function useGame(options: GameOptions = {}, platformHook?: unknown): Game
const cursor = useCursor(gameStatusManager);
const cursorPosition = cursor.position();
useCursorRender(containerRef, cursorPosition);
useCursorRender(containerRef, cursorPosition, gameStatus);
const [keyLog, setKeyLog] = useState<{ key: string; timestamp: number }[]>([]);