attempt at fixing ability to join non-existent lobbies

This commit is contained in:
IM23a-cernik
2025-04-28 14:39:51 +02:00
parent 10dc9b76d8
commit 69b7757fa1
+4 -2
View File
@@ -16,8 +16,10 @@ async function createLobby() {
} }
async function joinLobby(lobbyId, player_name) { async function joinLobby(lobbyId, player_name) {
let response = await fetch(`https://www.deckofcardsapi.com/api/deck/${lobbyId}/pile/${player_name}/add/?cards=`) if (playerMap[lobbyId]) {
console.log(response); let response = await fetch(`https://www.deckofcardsapi.com/api/deck/${lobbyId}/pile/${player_name}/add/?cards=`)
console.log(response);
} else console.log("Lobby with "+lobbyId+" not found.");
} }
app.get("/lobby/create", async (req, res) => { app.get("/lobby/create", async (req, res) => {