From 3a059d8874bf2463dab48bfe0bb08c36ef7a1b1f Mon Sep 17 00:00:00 2001 From: Nathaniel Tampus Date: Wed, 22 Mar 2023 15:40:10 +0800 Subject: [PATCH] fix for joining links with no http/https --- client/src/components/home/JoinGame.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/src/components/home/JoinGame.tsx b/client/src/components/home/JoinGame.tsx index eb8e72a..77090ad 100644 --- a/client/src/components/home/JoinGame.tsx +++ b/client/src/components/home/JoinGame.tsx @@ -24,7 +24,10 @@ export default function JoinGame() { 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]; }