fix for joining links with no http/https

This commit is contained in:
Nathaniel Tampus
2023-03-22 15:40:10 +08:00
parent e03052b00e
commit 3a059d8874

View File

@@ -24,7 +24,10 @@ export default function JoinGame() {
setButtonLoading(true); setButtonLoading(true);
if (code.startsWith("http") || code.startsWith("ches.su")) { if (code.startsWith("ches.su")) {
code = "http://" + code;
}
if (code.startsWith("http")) {
code = new URL(code).pathname.split("/")[1]; code = new URL(code).pathname.split("/")[1];
} }