From 64fa8682ef2438b3b8f0056f8365bb6bb5262612 Mon Sep 17 00:00:00 2001 From: IM23a-spirgif Date: Tue, 29 Apr 2025 11:40:59 +0200 Subject: [PATCH] Added Join button --- public/frontend_home.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/public/frontend_home.js b/public/frontend_home.js index 5f3013a..2e5e4cd 100644 --- a/public/frontend_home.js +++ b/public/frontend_home.js @@ -35,7 +35,7 @@ document.addEventListener("DOMContentLoaded", async () => { const logoutRes = await fetch('/logout', {method: "DELETE"}); if (logoutRes.ok) { document.cookie = "authorization=; Max-Age=0; path=/;"; - window.location.href = "/login"; + window.location.href = "/login.html"; } } catch (err) { console.log("Logout error:", err); @@ -91,11 +91,9 @@ document.addEventListener("DOMContentLoaded", async () => { const joinRes = await fetch(`/lobby/join?lobbyId=${lobbyId}&username=${username}`); if (joinRes.ok) { const {lobbyId: finalLobbyId} = await joinRes.json(); - document.getElementById("lobby-id").textContent = finalLobbyId; document.getElementById("lobby-room").classList.remove("hidden"); joinForm.classList.add("hidden"); - setInterval(async () => { const res = await fetch(`/lobby/players?lobbyId=${finalLobbyId}`); const data = await res.json();