From 9fb6009a9666b92b18436975409d3717128ec9ba Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Wed, 10 Jun 2020 07:25:13 -0700 Subject: [PATCH] Fix the /reset endpoint The fix here was pretty simple. I'd only missed this because I had forgotten to add an explicit setting of state.scores to null in the constructor, (so then forgot to also do the same in reset()). --- empathy.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/empathy.js b/empathy.js index 3ec4a7b..11539d8 100644 --- a/empathy.js +++ b/empathy.js @@ -7,7 +7,8 @@ class Empathy extends Game { this.state = { prompts: [], active_prompt: null, - players_answered: 0 + players_answered: 0, + scores: null }; this.answers = []; this.next_prompt_id = 1; @@ -16,6 +17,8 @@ class Empathy extends Game { reset() { this.state.active_prompt = null; this.state.players_answered = 0; + this.state.scores = null; + this.answers = []; this.broadcast_event_object('game-state', this.state); -- 2.43.0