summaryrefslogtreecommitdiff
path: root/public/join.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/join.js')
-rw-r--r--public/join.js27
1 files changed, 19 insertions, 8 deletions
diff --git a/public/join.js b/public/join.js
index 2774241..704868f 100644
--- a/public/join.js
+++ b/public/join.js
@@ -184,13 +184,25 @@ function update() {
element.innerHTML = user_link(player)
break
case 1:
- element.classList.toggle("is_active", is_active(player, role))
- if (player.user_id === user_id)
- element.innerHTML = play_link(player) + action_link(player, "part", "red", "\u274c")
- else if (game.owner_id === user_id)
- element.innerHTML = user_link(player) + action_link(player, "kick", "red", "\u274c")
- else
- element.innerHTML = user_link(player)
+ if (player.is_invite) {
+ element.classList.add("is_invite")
+ if (player.user_id === user_id)
+ element.innerHTML = player.name + " ?" +
+ action_link(player, "part", "red", "\u274c") +
+ action_link(player, "accept", "green", "\u2714")
+ else if (game.owner_id === user_id)
+ element.innerHTML = user_link(player) + " ?" + action_link(player, "kick", "red", "\u274c")
+ else
+ element.innerHTML = user_link(player) + " ?"
+ } else {
+ element.classList.toggle("is_active", is_active(player, role))
+ if (player.user_id === user_id)
+ element.innerHTML = play_link(player) + action_link(player, "part", "red", "\u274c")
+ else if (game.owner_id === user_id)
+ element.innerHTML = user_link(player) + action_link(player, "kick", "red", "\u274c")
+ else
+ element.innerHTML = user_link(player)
+ }
break
case 0:
if (player.is_invite) {
@@ -204,7 +216,6 @@ function update() {
else
element.innerHTML = user_link(player) + " ?"
} else {
- element.classList.remove("is_invite")
if (player.user_id === user_id)
element.innerHTML = player.name + action_link(player, "part", "red", "\u274c")
else if (game.owner_id === user_id)