fix join game from url

This commit is contained in:
Nathaniel Tampus
2023-03-22 14:57:40 +08:00
parent 5e2d676450
commit 30977baa5b

View File

@@ -25,7 +25,7 @@ export default function JoinGame() {
setButtonLoading(true); setButtonLoading(true);
if (code.startsWith("http") || code.startsWith("ches.su")) { 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); const game = await getGame(code);