fix: maybe there's not a conviction of direct voting (#7262)

* fix: maybe there's not a conviction of direct voting

* fix: conviction exist check
This commit is contained in:
Jay 2022-03-30 00:45:51 +08:00 committed by GitHub
parent 29a6ef6a0c
commit e8f1ea5a89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,7 +51,7 @@ function groupLocks (t: TFunction, bestNumber: BN, locks: Partial<DeriveDemocrac
.reduce((sorted: Entry[], [{ balance, isDelegated, isFinished = false, referendumId, vote }, blocks]): Entry[] => {
const isCountdown = blocks.gt(BN_ZERO);
const header = referendumId && vote
? <div>#{referendumId.toString()} {formatBalance(balance, { forceUnit: '-' })} {vote.conviction.toString()}{isDelegated && '/d'}</div>
? <div>#{referendumId.toString()} {formatBalance(balance, { forceUnit: '-' })} {vote.conviction?.toString()}{isDelegated && '/d'}</div>
: <div>{t('Prior locked voting')}</div>;
const prev = sorted.length ? sorted[sorted.length - 1] : null;