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>{' '}
{votersCount === 1 ? 'voter' : 'voters'}
{votersCount !== votesCount && (
<span title={votesCount}>{shortenNumber(votesCount)}</span> vote
{votesCount === 1 ? '' : 's'}
{!!votersCount && votersCount !== votesCount && (
<>
{' '}
&bull; <span title={votesCount}>
{shortenNumber(votesCount)}
</span>{' '}
vote
{votesCount === 1 ? '' : 's'}
&bull;{' '}
<span title={votersCount}>{shortenNumber(votersCount)}</span>{' '}
voter
{votersCount === 1 ? '' : 's'}
</>
)}{' '}
&bull; {expired ? 'Ended' : 'Ending'}{' '}