Fix: salva stato dopo inserimento nome e su toggleX, clear su nuova partita

This commit is contained in:
truetype committed 2026-06-16 17:47:12 +02:00
1 parent 43a091e0ec
commit a389640ea0
1 file changed
+3
+3
View File
@@ -452,6 +452,7 @@
if (cell.hasCat) return; // Can't X a cat cell
cell.hasX = !cell.hasX;
renderGrid();
saveGameState();
}
function flashError(row, col) {
@@ -640,6 +641,7 @@
state.score = 0;
state.hints = 3;
state.sessionRecords = [];
clearGameState(); // Cancella stato salvato per nuova partita
showNameInput();
});
@@ -675,6 +677,7 @@
}
hideNameInput();
initGame();
saveGameState(); // Salva subito dopo aver inserito il nome
}
});