From b883836f8a5a38007971a3cafef8b4f6d8ff1041 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Wed, 14 Dec 2022 17:56:08 +0800 Subject: [PATCH] Fix percentage count for multiple-choice polls --- src/components/status.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/status.jsx b/src/components/status.jsx index 0d2db256..213d1994 100644 --- a/src/components/status.jsx +++ b/src/components/status.jsx @@ -287,8 +287,9 @@ function Poll({ poll }) { {voted || expired ? ( options.map((option, i) => { const { title, votesCount: optionVotesCount } = option; + const pollVotesCount = votersCount || votesCount; const percentage = - Math.round((optionVotesCount / votesCount) * 100) || 0; + Math.round((optionVotesCount / pollVotesCount) * 100) || 0; return (