diff --git a/web-optimle/www/src/Game.tsx b/web-optimle/www/src/Game.tsx index 9b82637..e96609e 100644 --- a/web-optimle/www/src/Game.tsx +++ b/web-optimle/www/src/Game.tsx @@ -61,10 +61,6 @@ export function Game(props: GameProps) { setGuesses([...puzzle.history]); setCurrentGuess(""); setGameState(GameState.Playing); - setTodayStats((oldStats) => ({ - ...oldStats, - tries: oldStats.tries + 1, - })); }, []); useEffect(() => { @@ -181,6 +177,10 @@ export function Game(props: GameProps) { } else if (guesses.length + 1 === puzzle.history.length + MAX_GUESSES) { setHint(
Not quite! The answer could've been {game.possible_word().toUpperCase()}. (Enter to try again)
); setGameState(GameState.Lost); + setTodayStats((oldStats) => ({ + ...oldStats, + tries: oldStats.tries + 1, + })); } else { speak(describeClue(clue(result))); }