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")}>