Fix bug due to votersCount can be null if multiple=false

This commit is contained in:
Lim Chee Aun 2023-01-15 00:17:07 +08:00
parent f00cb82b2c
commit 0f5764580b

View file

@ -1134,16 +1134,15 @@ function Poll({ poll, lang, readOnly, onUpdate = () => {} }) {
•{' '} •{' '}
</> </>
)} )}
<span title={votersCount}>{shortenNumber(votersCount)}</span>{' '} <span title={votesCount}>{shortenNumber(votesCount)}</span> vote
{votersCount === 1 ? 'voter' : 'voters'} {votesCount === 1 ? '' : 's'}
{votersCount !== votesCount && ( {!!votersCount && votersCount !== votesCount && (
<> <>
{' '} {' '}
&bull; <span title={votesCount}> &bull;{' '}
{shortenNumber(votesCount)} <span title={votersCount}>{shortenNumber(votersCount)}</span>{' '}
</span>{' '} voter
vote {votersCount === 1 ? '' : 's'}
{votesCount === 1 ? '' : 's'}
</> </>
)}{' '} )}{' '}
&bull; {expired ? 'Ended' : 'Ending'}{' '} &bull; {expired ? 'Ended' : 'Ending'}{' '}