From 856dbf9d11aee119089b7687b804101716d1942c Mon Sep 17 00:00:00 2001 From: Aapo Laakkio Date: Thu, 5 Dec 2024 22:00:09 +0200 Subject: [PATCH] Fix minutes to have correct words when zero votes --- src/frontend/components/shared/ElectionResults.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/components/shared/ElectionResults.tsx b/src/frontend/components/shared/ElectionResults.tsx index 305f820..121f348 100644 --- a/src/frontend/components/shared/ElectionResults.tsx +++ b/src/frontend/components/shared/ElectionResults.tsx @@ -56,7 +56,7 @@ export const ElectionResults = ({ a.name.localeCompare(b.name) ) - const firstParagraph = `Ääniä annettiin ${totalVotes} ${totalVotes > 1 ? 'kappaletta' : 'kappale'}, joista ${emptyVotes} oli ${emptyVotes > 1 ? 'tyhjiä' : 'tyhjä'}. Äänestystulos oli vaalikelpoinen.` + const firstParagraph = `Ääniä annettiin ${totalVotes} ${totalVotes !== 1 ? 'kappaletta' : 'kappale'}, joista ${emptyVotes} oli ${emptyVotes !== 1 ? 'tyhjiä' : 'tyhjä'}. Äänestystulos oli vaalikelpoinen.` const firstDecimalVotesRound = votingResult.roundResults.find( ({ candidateResults }) => { return candidateResults.some(({ voteCount }) => voteCount % 1 !== 0)