Skip to content

fix: Fix idle workers display showing player1's workers when spectating#1143

Merged
braedonsaunders merged 1 commit into
mainfrom
claude/fix-ai-workers-display-w6MBv
Jan 30, 2026
Merged

fix: Fix idle workers display showing player1's workers when spectating#1143
braedonsaunders merged 1 commit into
mainfrom
claude/fix-ai-workers-display-w6MBv

Conversation

@braedonsaunders

Copy link
Copy Markdown
Owner
  • Fix gameStore.syncWithGameSetup() to properly handle spectator mode by setting playerId to empty string when localPlayerId is null
  • Add syncWithGameSetup() call when game loading completes to ensure playerId is synced with the actual game setup state
  • Reset idle worker count to 0 in IdleWorkerButton when transitioning to spectator mode to prevent stale data display

When spectating all-AI games, the playerId in gameStore was staying as 'player1' (the default) because syncWithGameSetup() only updated when localPlayerId was truthy. This caused the IdleWorkerButton to show player 1's workers even though the user was spectating.

https://claude.ai/code/session_012UE6oa6ZDLCFVLJYwVW3b5

- Fix gameStore.syncWithGameSetup() to properly handle spectator mode by
  setting playerId to empty string when localPlayerId is null
- Add syncWithGameSetup() call when game loading completes to ensure
  playerId is synced with the actual game setup state
- Reset idle worker count to 0 in IdleWorkerButton when transitioning
  to spectator mode to prevent stale data display

When spectating all-AI games, the playerId in gameStore was staying as
'player1' (the default) because syncWithGameSetup() only updated when
localPlayerId was truthy. This caused the IdleWorkerButton to show
player 1's workers even though the user was spectating.

https://claude.ai/code/session_012UE6oa6ZDLCFVLJYwVW3b5
@braedonsaunders braedonsaunders merged commit 74d38a6 into main Jan 30, 2026
4 checks passed
@braedonsaunders braedonsaunders deleted the claude/fix-ai-workers-display-w6MBv branch January 30, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants