Răsfoiți Sursa

fix: reset stale guesses when the daily word changes

Co-Authored-By: Claude <noreply@anthropic.com>
Oleg Panashchenko 1 lună în urmă
părinte
comite
27e480ea68
2 a modificat fișierele cu 9 adăugiri și 0 ștergeri
  1. 4 0
      client/src/App.tsx
  2. 5 0
      raw/14-new-word-clean.md

+ 4 - 0
client/src/App.tsx

@@ -46,6 +46,8 @@ export default function App() {
           else setScreen('game');
         } else {
           if (stored) updateState({ currentGame: undefined });
+          // New word — clear any guesses restored from the previous word (raw/14)
+          resetForNewGame();
           setWordId(res.wordId);
         }
       }).catch(() => {
@@ -67,6 +69,8 @@ export default function App() {
         } else {
           // New word — fresh start
           if (stored) updateState({ currentGame: undefined });
+          // Clear any guesses restored from the previous word (raw/14)
+          resetForNewGame();
           setWordId(res.wordId);
           setScreen('game');
         }

+ 5 - 0
raw/14-new-word-clean.md

@@ -0,0 +1,5 @@
+## clean new game start
+By now when daily-word API returns not the same word id as last guessed daily word in local storage, UI shows data for last solved daily word.
+Change the above. When daily-word id from API is not the same as last solved daily word, show fresh guess screen.
+When daily-word id is thr same as last solved, keep showing solved daily word.
+