kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
Merge branch 'neetzsche/fix-poll-bug' into 'main'
Fix poll percentage bug See merge request soapbox-pub/soapbox!2917
commit
9617e482a6
|
@ -112,7 +112,7 @@ const PollOption: React.FC<IPollOption> = (props): JSX.Element | null => {
|
|||
|
||||
if (!poll) return null;
|
||||
|
||||
const pollVotesCount = poll.voters_count || poll.votes_count;
|
||||
const pollVotesCount = poll.votes_count || poll.voters_count;
|
||||
const percent = pollVotesCount === 0 ? 0 : (option.votes_count / pollVotesCount) * 100;
|
||||
const voted = poll.own_votes?.includes(index);
|
||||
const message = intl.formatMessage(messages.votes, { votes: option.votes_count });
|
||||
|
|
Ładowanie…
Reference in New Issue