]> cat aescling's git repositories - mastodon.git/commitdiff
Change vote results to display ex-aequo leading options as leading (#12001)
authorThibG <thib@sitedethib.com>
Sun, 29 Sep 2019 19:23:40 +0000 (21:23 +0200)
committerEugen Rochko <eugen@zeonfederated.com>
Sun, 29 Sep 2019 19:23:40 +0000 (21:23 +0200)
app/javascript/mastodon/components/poll.js

index dd7e2fcd3f844d23a75f12d7a94cee06c2d9b1ba..f88d260f246c7590876173c3dd9044165b0c097d 100644 (file)
@@ -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));