From f7a9c4a4c2f5954ee3ca4c6a846df550aebc23de Mon Sep 17 00:00:00 2001 From: ashastral Date: Tue, 15 Mar 2022 22:27:30 -0700 Subject: [PATCH] fix initial hint --- web-optimle/www/src/Game.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/web-optimle/www/src/Game.tsx b/web-optimle/www/src/Game.tsx index 5fb1143..60ac1c4 100644 --- a/web-optimle/www/src/Game.tsx +++ b/web-optimle/www/src/Game.tsx @@ -65,11 +65,7 @@ export function Game(props: GameProps) { 3: defaultPuzzleStats(), 4: defaultPuzzleStats(), }); - const [hint, setHint] = useState( -

- Try to guarantee a win in 2 guesses! -

- ); + const [hint, setHint] = useState(''); const [shareMsg, setShareMsg] = useState(""); const tableRef = useRef(null); const game = useMemo( @@ -135,7 +131,11 @@ export function Game(props: GameProps) { setHint(

Not quite! The answer could've been {game.possible_word().toUpperCase()}. (Enter to try again)

); } else { setGameState(GameState.Playing); - setHint(""); + if (selectedPuzzle.guesses?.length) { + setHint(""); + } else { + setHint(

Try to guarantee a win in 2 guesses!

); + } } }, [puzzle, puzzleType, todayStats]);