Skip to content

Commit

Permalink
Added confirmation dialog for ending the game.
Browse files Browse the repository at this point in the history
  • Loading branch information
przemyslaw-zan committed Jan 10, 2025
1 parent 12e0007 commit 5e6ab15
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/components/InfoPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ export function InfoPage( { gameStatus, setGameStatus, setCurrentPage }: PagePro
{ playerGameData.isHost && (
<button
onClick={ () => {
const confirmed = confirm( 'Are you sure to end this game and go back to lobby?' );

if ( !confirmed ) {
return;
}

setGameStatus( null );
setCurrentPage( 'gameSetup' );
} }
Expand Down

0 comments on commit 5e6ab15

Please sign in to comment.