New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: voting with same answers #5674
Conversation
…ng-with-same-answer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if i fully understand everything you're doing here but i have another way in mind how we could solve this.
Instead of setting things to undefined if we select the already voted one, and then handle this in the handleVoteClick
, we could just update the check in isVotingDisabled
with a function areAllSelectedAnswersAlreadyActive
where we compare the 2 arrays
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, good job!
Summary
This PR fixes users being able to submit votes with the same answers. It also allows a user to vote, switching just a single answer if he or she wishes.
Changelog
Relevant Issues
Fixes #5634
Testing
Platforms
Instructions
Test with long and short ballots, including ones that are being actively voted for and new ones.
Checklist