Skip to content

Commit

Permalink
Update useGameState.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
ProLoser authored Oct 2, 2024
1 parent 58cf1c9 commit 3d40746
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Game/useGameState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ export default function useGameState(gameId?: string) {
if (confirm('Are you sure you want to reset the match?')) {
console.log('Resetting', gameId);
let data = newGame()
firebase.database().ref(`games/${gameId}`).set(data);
if (gameId)
firebase.database().ref(`games/${gameId}`).set(data);
dispatch({ type: Actions.SET_GAME, data });
}
}
Expand Down

0 comments on commit 3d40746

Please sign in to comment.