Skip to content

Commit

Permalink
Merge staging - Remove welcome roll condition (#47)
Browse files Browse the repository at this point in the history
* removed welcome roll condition (#46)
  • Loading branch information
Avelous authored Jul 24, 2024
1 parent 4a481d6 commit 8be238a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/nextjs/components/dicedemo/GameJoinForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const GameJoinForm = ({
// };

useEffect(() => {
if (invite) {
if (invite && playerAddress) {
handleJoinGame(invite as string);
}
if (Object.keys(router.query).length > 0) {
Expand All @@ -83,7 +83,7 @@ const GameJoinForm = ({
});
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [invite]);
}, [invite, playerAddress]);

return (
<div className="w-full">
Expand Down
4 changes: 1 addition & 3 deletions packages/nextjs/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

Expand All @@ -36,7 +34,7 @@ const Home: NextPage = () => {

<div>
<div className="mx-auto mt-5 border p-6 rounded-md bg-base-100 shadow-2xl">
{showWelcomeRoll && <WelcomeRoll />}
<WelcomeRoll />
<div className="flex justify-center mt-10">
<ul className="menu menu-horizontal justify-center p-2 bg-base-300 rounded-full mb-8 w-fit mx-auto">
<li onClick={() => setGameState("joinGame")}>
Expand Down

0 comments on commit 8be238a

Please sign in to comment.