mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-12-20 04:07:45 +00:00
[Glitch] Change vote results to display ex-aequo leading options as leading
Port 15b3eeb326
to glitch-soc
Signed-off-by: Thibaut Girka <thib@sitedethib.com>
This commit is contained in:
parent
ec244f6c88
commit
332be562ea
|
@ -103,7 +103,7 @@ class Poll extends ImmutablePureComponent {
|
|||
renderOption (option, optionIndex, showResults) {
|
||||
const { poll, disabled, intl } = this.props;
|
||||
const percent = poll.get('votes_count') === 0 ? 0 : (option.get('votes_count') / poll.get('votes_count')) * 100;
|
||||
const leading = poll.get('options').filterNot(other => other.get('title') === option.get('title')).every(other => option.get('votes_count') > other.get('votes_count'));
|
||||
const leading = poll.get('options').filterNot(other => other.get('title') === option.get('title')).every(other => option.get('votes_count') >= other.get('votes_count'));
|
||||
const active = !!this.state.selected[`${optionIndex}`];
|
||||
const voted = option.get('voted') || (poll.get('own_votes') && poll.get('own_votes').includes(optionIndex));
|
||||
|
||||
|
|
Loading…
Reference in a new issue