Merge pull request #41 from samuel-rey/notyping

Fixes #40 - Prevent typing after winning game
This commit is contained in:
Hannah Park 2022-01-23 10:09:22 -05:00 committed by GitHub
commit 00630b24bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -50,7 +50,7 @@ function App() {
}, [isGameWon])
const onChar = (value: string) => {
if (currentGuess.length < 5 && guesses.length < 6) {
if (currentGuess.length < 5 && guesses.length < 6 && !isGameWon) {
setCurrentGuess(`${currentGuess}${value}`)
}
}