X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=empathy.js;h=60e1ecfd825b53de2db2132c0dd9987c15076229;hb=2b198e296f7a247156d554631896cb04e1ca1251;hp=11539d854a4473c38be1b7a8373f903986bef7f5;hpb=9fb6009a9666b92b18436975409d3717128ec9ba;p=empires-server diff --git a/empathy.js b/empathy.js index 11539d8..60e1ecf 100644 --- a/empathy.js +++ b/empathy.js @@ -15,6 +15,16 @@ class Empathy extends Game { } reset() { + /* Now that we're done with the active prompt, we remove it from + * the list of prompts and also remove any prompts that received + * no votes. This keeps the list of prompts clean. + */ + const active_id = this.state.active_prompt.id; + this.state.prompts = + this.state.prompts.filter( + p => p.id !== active_id && p.votes.length > 0 + ); + this.state.active_prompt = null; this.state.players_answered = 0; this.state.scores = null;