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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user