Merge branch 'neetzsche/fix-poll-bug' into 'main'

Fix poll percentage bug

See merge request soapbox-pub/soapbox!2917
NEETzsche 2024-04-19 22:50:19 +00:00
commit 235463a6fc
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -111,7 +111,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 });