add confirmation dialog before exiting the game

This commit is contained in:
Sajad Hashemian
2025-02-17 00:38:40 +01:00
parent 0f325d4be8
commit 3d3ad3cece
+5 -1
View File
@@ -52,7 +52,11 @@ export class OptionsMenu extends LitElement implements Layer {
private hasWinner = false;
private onExitButtonClick() {
window.location.reload();
const isConfirmed = confirm("Are you sure you want to exit the game?");
if (isConfirmed) {
window.location.reload();
}
}
createRenderRoot() {