mirror of
https://github.com/aquatix/alfagok.git
synced 2025-12-06 19:55:12 +01:00
Reset game state when new/different game has started
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user