[frontend/components] Don't allow repeated multiple choice votes

This commit is contained in:
pancakes 2024-12-31 00:20:27 +10:00 committed by Lilian
parent 6c31197bbc
commit e091eb01e9
No known key found for this signature in database

View file

@ -62,7 +62,7 @@
private bool CanVote() private bool CanVote()
{ {
return (Poll.Multiple && !Poll.Choices.All(p => p.Voted) || !Poll.Choices.Any(p => p.Voted)) && (Poll.ExpiresAt == null || Poll.ExpiresAt > DateTime.UtcNow); return !Poll.Choices.Any(p => p.Voted) && (Poll.ExpiresAt == null || Poll.ExpiresAt > DateTime.UtcNow);
} }
private void SelectMultiple(int choice) private void SelectMultiple(int choice)