From 30977baa5b83b19799a4d9ca3918a3749cb8c7ae Mon Sep 17 00:00:00 2001 From: Nathaniel Tampus Date: Wed, 22 Mar 2023 14:57:40 +0800 Subject: [PATCH] fix join game from url --- client/src/components/home/JoinGame.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/home/JoinGame.tsx b/client/src/components/home/JoinGame.tsx index c212a89..eb8e72a 100644 --- a/client/src/components/home/JoinGame.tsx +++ b/client/src/components/home/JoinGame.tsx @@ -25,7 +25,7 @@ export default function JoinGame() { setButtonLoading(true); if (code.startsWith("http") || code.startsWith("ches.su")) { - code = new URL(code).pathname.split("/")[2]; + code = new URL(code).pathname.split("/")[1]; } const game = await getGame(code);