FIX: don't send xhr request when vote limit is reached (#57)
When the user used all the votes we should not send a request to create a vote. We should only display information about votes. The bug was mentioned on meta: https://meta.discourse.org/t/the-vote-button-should-be-disabled-when-the-limit-is-reached/68902
This commit is contained in:
parent
fdedc0e159
commit
1d501226fe
|
@ -77,7 +77,8 @@ export default createWidget("vote-button", {
|
|||
if (
|
||||
!this.attrs.closed &&
|
||||
this.parentWidget.state.allowClick &&
|
||||
!this.attrs.user_voted
|
||||
!this.attrs.user_voted &&
|
||||
!this.currentUser.votes_exceeded
|
||||
) {
|
||||
this.parentWidget.state.allowClick = false;
|
||||
this.parentWidget.state.initialVote = true;
|
||||
|
|
Loading…
Reference in New Issue