fix: defer URL update until game starts

Move router.push() from mode selection to game start button.
This prevents the game from rebooting when user is exploring
different race types in the setup screen.

Now the flow is:
1. User selects race type → background preview changes
2. User clicks 'Start Your Race!' → URL updates + game begins

This keeps the setup experience smooth while still providing
shareable URLs once the game starts.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Thomas Hallock 2025-09-30 15:06:56 -05:00
parent 73a59745a5
commit 12c54b27b7
1 changed files with 2 additions and 2 deletions

View File

@ -14,8 +14,6 @@ export function GameControls() {
const handleStyleSelect = (style: GameStyle) => {
dispatch({ type: 'SET_STYLE', style })
// Update URL to match selected game style
router.push(`/games/complement-race/${style}`)
}
const handleTimeoutSelect = (timeout: TimeoutSetting) => {
@ -23,6 +21,8 @@ export function GameControls() {
}
const handleStartRace = () => {
// Update URL to match selected game style when starting
router.push(`/games/complement-race/${state.style}`)
dispatch({ type: 'START_COUNTDOWN' })
}