mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-28 01:21:36 +01:00
parent
6fe48dd050
commit
ca45198ccb
1 changed files with 1 additions and 1 deletions
|
@ -94,7 +94,7 @@ class Poll extends ImmutablePureComponent {
|
||||||
|
|
||||||
renderOption (option, optionIndex) {
|
renderOption (option, optionIndex) {
|
||||||
const { poll, disabled } = this.props;
|
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 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 active = !!this.state.selected[`${optionIndex}`];
|
||||||
const showResults = poll.get('voted') || poll.get('expired');
|
const showResults = poll.get('voted') || poll.get('expired');
|
||||||
|
|
Loading…
Reference in a new issue