Validate words on typing the last letter

pull/86/head
Alexander Yakovlev 2022-02-10 20:02:30 +07:00
rodzic 1c1ddbcc6e
commit cd303c14d6
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 8D24103F5EE2A6C0
1 zmienionych plików z 4 dodań i 0 usunięć

Wyświetl plik

@ -135,6 +135,10 @@ function Game(props: GameProps) {
setCurrentGuess((guess) =>
(guess + key.toLowerCase()).slice(0, wordLength)
);
if ((currentGuess.length + 1) === wordLength && !dictionary.includes(currentGuess + key.toLowerCase())) {
setHint("Not a valid word");
return;
}
tableRef.current?.focus();
setHint("");
} else if (key === "Backspace") {