Skip to content

Commit

Permalink
change mode before game component mounts
Browse files Browse the repository at this point in the history
  • Loading branch information
staranbeer committed Sep 21, 2022
1 parent abdcd39 commit 74240f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ const App = () => {

return (
<>
<Layout>
<Game />
</Layout>
<Layout>{hasStarted && <Game />}</Layout>

{/* intro modal */}
{
Expand Down
2 changes: 1 addition & 1 deletion src/components/Layout/Game/Game.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ const Game = () => {
setPressedKey("");
setCurrentKey(code[0]);
}
}, [hasEnded]);
}, [hasEnded, restarted]);

return (
<HStack justify="center" h="full" w="full">
Expand Down

0 comments on commit 74240f5

Please sign in to comment.