From 8be238af300ff9952ccacc74e37b426fd55d159a Mon Sep 17 00:00:00 2001 From: Avelous Ujiri <86206128+Avelous@users.noreply.github.com> Date: Wed, 24 Jul 2024 15:26:54 +0100 Subject: [PATCH] Merge staging - Remove welcome roll condition (#47) * removed welcome roll condition (#46) --- packages/nextjs/components/dicedemo/GameJoinForm.tsx | 4 ++-- packages/nextjs/pages/index.tsx | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/nextjs/components/dicedemo/GameJoinForm.tsx b/packages/nextjs/components/dicedemo/GameJoinForm.tsx index ac5d2b9..c2265f0 100644 --- a/packages/nextjs/components/dicedemo/GameJoinForm.tsx +++ b/packages/nextjs/components/dicedemo/GameJoinForm.tsx @@ -73,7 +73,7 @@ const GameJoinForm = ({ // }; useEffect(() => { - if (invite) { + if (invite && playerAddress) { handleJoinGame(invite as string); } if (Object.keys(router.query).length > 0) { @@ -83,7 +83,7 @@ const GameJoinForm = ({ }); } // eslint-disable-next-line react-hooks/exhaustive-deps - }, [invite]); + }, [invite, playerAddress]); return (
diff --git a/packages/nextjs/pages/index.tsx b/packages/nextjs/pages/index.tsx index f678422..55ccad4 100644 --- a/packages/nextjs/pages/index.tsx +++ b/packages/nextjs/pages/index.tsx @@ -12,13 +12,11 @@ const Home: NextPage = () => { const { invite } = router.query; const [gameState, setGameState] = useState<"createGame" | "joinGame">("joinGame"); const [inviteCode, setInviteCode] = useState(""); - const [showWelcomeRoll, setShowWelcomRoll] = useState(true); useEffect(() => { if (invite) { setGameState("joinGame"); setInviteCode(invite as string); - setShowWelcomRoll(false); } }, [invite]); @@ -36,7 +34,7 @@ const Home: NextPage = () => {
- {showWelcomeRoll && } +
  • setGameState("joinGame")}>