Skip to content

Commit

Permalink
#ExitButtonWarning
Browse files Browse the repository at this point in the history
- Added the warning for the exit button.
  • Loading branch information
CheBato committed Mar 3, 2025
1 parent ec6f040 commit eb23e45
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ interface LeaveGamePopupProps {
}

export const LeaveGamePopupModule = ({ uuid }: LeaveGamePopupProps) => {
const { sendMessage } = useGame();
const { sendMessage, gameState } = useGame();
const { closePopup } = usePopup();
const router = useRouter();

const hasWinner = !!gameState?.winner;
const handleConfirm = () => {
sendMessage('manualDisconnect');
closePopup(uuid);
Expand All @@ -36,7 +36,7 @@ export const LeaveGamePopupModule = ({ uuid }: LeaveGamePopupProps) => {
<Typography sx={titleStyle}>Leave Game</Typography>
</Box>
<Typography sx={textStyle}>
Leaving the game will concede.
{hasWinner ? 'Leave the game and return to homescreen?' : 'Leaving the game will concede.' }
</Typography>
<Box sx={footerStyle}>
<PreferenceButton
Expand Down

0 comments on commit eb23e45

Please sign in to comment.