fix(nav): navigate to room after creation from (+) menu

When creating a room from the /arcade page using the (+) button:
- Add room to recent rooms list
- Close the popover
- Navigate to the room page immediately

This fixes the UX issue where users would create a room but
remain on the /arcade page without any clear indication of
how to access their new room.

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Thomas Hallock
2025-10-14 10:28:14 -05:00
parent 6d16436133
commit 21e6e33173

View File

@@ -72,8 +72,16 @@ export function AddPlayerButton({
},
{
onSuccess: (data) => {
// Popover stays open, switch to invite tab to share room code
setActiveTab('invite')
// Add to recent rooms
addToRecentRooms({
code: data.code,
name: data.name,
gameName: data.gameName,
})
// Close popover
setShowPopover(false)
// Navigate to the room page
router.push(`/arcade/rooms/${data.id}`)
},
onError: (error) => {
console.error('Failed to create room:', error)