Revert "fix(Polls): Calculate vote percentage based on total number of votes" (#10781)

This reverts commit 69cbb7e103.
This commit is contained in:
Avram Tudor 2022-01-12 18:28:24 +02:00 committed by GitHub
parent 30f2fe3577
commit b3e1c5446c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -72,10 +72,10 @@ const AbstractPollResults = (Component: AbstractComponent<AbstractProps>) => (pr
}
}
const totalVotes = pollDetails.answers.reduce((sum, { voters: { size } }) => sum + size, 0);
const totalVoters = voterSet.size;
return pollDetails.answers.map(answer => {
const percentage = totalVotes === 0 ? 0 : Math.round(answer.voters.size / totalVotes * 100);
const percentage = totalVoters === 0 ? 0 : Math.round(answer.voters.size / totalVoters * 100);
let voters = null;