diff --git a/src/alfagok/static/game.js b/src/alfagok/static/game.js index 81eb4fb..f5e2699 100644 --- a/src/alfagok/static/game.js +++ b/src/alfagok/static/game.js @@ -35,6 +35,9 @@ document.addEventListener('alpine:init', () => { console.log(result); this.loading = false; if (result.game) { + if (this.gameID !== result.game) { + this.setEmptyGameState(); + } return this.gameID = result.game; } }, @@ -116,10 +119,6 @@ document.addEventListener('alpine:init', () => { this.getGameID(); }, - // # Local Storage Persistence - resetSavedGames() { - localStorage.removeItem(this.savedGameKey); - }, // # Countdown timer getFormattedTime(milliseconds) { if (!Number.isInteger(milliseconds)) {