fix join game from url

This commit is contained in:
Nathaniel Tampus
2023-03-22 14:57:40 +08:00
parent 4c18beeb3b
commit e03052b00e

View File

@@ -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);