update stats on loss, not on reset
This commit is contained in:
parent
61461e6d62
commit
4dd91ad03c
1 changed files with 4 additions and 4 deletions
|
@ -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(<p>Not quite! The answer could've been <strong>{game.possible_word().toUpperCase()}</strong>. (Enter to try again)</p>);
|
||||
setGameState(GameState.Lost);
|
||||
setTodayStats((oldStats) => ({
|
||||
...oldStats,
|
||||
tries: oldStats.tries + 1,
|
||||
}));
|
||||
} else {
|
||||
speak(describeClue(clue(result)));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue