about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/components
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-03-08 01:47:36 +0100
committerGitHub <noreply@github.com>2019-03-08 01:47:36 +0100
commit29a09858f6700c0a6eb17797836589ed0839dec9 (patch)
tree96ac7fbac23d6ca32704c143342b5606523c8cab /app/javascript/flavours/glitch/components
parent38e9c66f34d7054357a3de63834f182734d43d75 (diff)
parentca45198ccbbdde88731f074fcab2b5c9310775c2 (diff)
Merge pull request #945 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/javascript/flavours/glitch/components')
-rw-r--r--app/javascript/flavours/glitch/components/poll.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/components/poll.js b/app/javascript/flavours/glitch/components/poll.js
index bfff7b601..a1b297ce7 100644
--- a/app/javascript/flavours/glitch/components/poll.js
+++ b/app/javascript/flavours/glitch/components/poll.js
@@ -94,7 +94,7 @@ class Poll extends ImmutablePureComponent {
 
   renderOption (option, optionIndex) {
     const { poll, disabled } = this.props;
-    const percent            = (option.get('votes_count') / poll.get('votes_count')) * 100;
+    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 active             = !!this.state.selected[`${optionIndex}`];
     const showResults        = poll.get('voted') || poll.get('expired');