Merge pull request #38 from sajadhsm/confirm-exit

Add confirmation dialog before exiting the game while player is alive
This commit is contained in:
evanpelle
2025-02-17 16:22:31 -08:00
committed by GitHub
@@ -52,6 +52,12 @@ export class OptionsMenu extends LitElement implements Layer {
private hasWinner = false;
private onExitButtonClick() {
const isAlive = this.game.myPlayer()?.isAlive();
if (isAlive) {
const isConfirmed = confirm("Are you sure you want to exit the game?");
if (!isConfirmed) return;
}
window.location.reload();
}