Re-render "who voted" list when a vote is removed (#26)

Ensures that `this.scheduleRerender()` is always called when adding or removing a vote; this will ensure that the "who voted" list is updated. This fixes https://meta.discourse.org/t/avatar-still-shown-in-voted-pane-after-vote-removed/66480 .
This commit is contained in:
Barry van Oudtshoorn 2018-07-31 16:19:26 +08:00 committed by Sam
parent d176ba458e
commit a1af75013b
1 changed files with 2 additions and 1 deletions

View File

@ -62,10 +62,10 @@ export default createWidget('vote-box', {
this.currentUser.set('votes_exceeded', !result.can_vote);
if (result.alert) {
state.votesAlert = result.votes_left;
this.scheduleRerender();
}
topic.set('who_voted', result.who_voted);
state.allowClick = true;
this.scheduleRerender();
}).catch(popupAjaxError);
},
@ -83,6 +83,7 @@ export default createWidget('vote-box', {
this.currentUser.set('votes_exceeded', !result.can_vote);
topic.set('who_voted', result.who_voted);
state.allowClick = true;
this.scheduleRerender();
}).catch(popupAjaxError);
}