From 401a13ff9e7792f0e060ccfb15afdbd3bc5fc557 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 28 Jun 2021 12:38:42 +0200 Subject: Clean up SQL and use table views. --- public/join.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'public/join.js') diff --git a/public/join.js b/public/join.js index d2d39ab..5353f11 100644 --- a/public/join.js +++ b/public/join.js @@ -84,24 +84,23 @@ function update() { let element = document.getElementById(role_id); if (player) { if (game.status > 0) { - if (game.active === role || game.active === "Both" || game.active === "All") - element.className = "your_turn"; + if (game.active_role === role || game.active_role === "Both" || game.active_role === "All") + element.className = "is_your_turn"; else element.className = ""; if (player.user_id === user_id) element.innerHTML = `Play`; else - element.innerHTML = player.name; + element.innerHTML = player.user_name; } else { if ((player.user_id === user_id) || (game.owner_id === user_id)) - element.innerHTML = `\u274c ${player.name}`; + element.innerHTML = `\u274c ${player.user_name}`; else - element.innerHTML = player.name; + element.innerHTML = player.user_name; } } else { if (game.status === 0) - //element.innerHTML = `Join`; - element.innerHTML = `Join`; + element.innerHTML = `Join`; else element.innerHTML = "Empty"; } @@ -122,7 +121,7 @@ function update() { if (game.owner_id === user_id) { window.start_button.disabled = !ready; window.start_button.classList = (game.status === 0) ? "" : "hide"; - window.delete_button.classList = (game.status === 0 || solo) ? "" : "hide"; + window.delete_button.classList = (game.status === 0 || game.is_solo) ? "" : "hide"; } if (game.status === 0 && ready) -- cgit v1.2.3