From 7a74c7c98826465f1cc0524f2717417df35a5097 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Sun, 14 Jun 2020 14:57:10 -0700 Subject: [PATCH] Remove player names from answering and judging when they submit Without this fix, reloading the "still waiting" view would make player names that had previously submitted erroneously appear in the "still waiting" list once again. --- empathy.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/empathy.js b/empathy.js index ae400a6..abaf72f 100644 --- a/empathy.js +++ b/empathy.js @@ -135,8 +135,11 @@ class Empathy extends Game { answers: answers }); - /* And notify all players that this player has answered. */ + /* Update state (to be sent out to any future clients) */ + this.state.players_answering.delete(player.name); this.state.players_answered.push(player.name); + + /* And notify all players that this player has answered. */ this.broadcast_event_object('player-answered', player.name); return { valid: true }; @@ -244,8 +247,11 @@ class Empathy extends Game { } } - /* And notify all players this this player has judged. */ + /* Update state (to be sent out to any future clients) */ + this.state.players_judging.delete(player.name); this.state.players_judged.push(player.name); + + /* And notify all players this this player has judged. */ this.broadcast_event_object('player-judged', player.name); return { valid: true }; -- 2.43.0