Fix envelope status display (#3623)

This commit is contained in:
Jaco Greeff 2020-09-06 11:32:44 +02:00 committed by GitHub
parent 628f2e5466
commit fbd1826059
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,6 +17,8 @@ interface Props {
}
function Status ({ isElected, isMain, numNominators, onlineCount, onlineMessage }: Props): React.ReactElement<Props> {
const blockCount = onlineCount && onlineCount.toNumber();
return (
<>
{isElected
@ -29,11 +31,11 @@ function Status ({ isElected, isMain, numNominators, onlineCount, onlineMessage
: <Badge color='transparent' />
}
{isMain && (
!!onlineCount || onlineMessage
blockCount || onlineMessage
? (
<Badge
color='green'
info={onlineCount ? onlineCount.toNumber() : <Icon icon='envelope' />}
info={blockCount || <Icon icon='envelope' />}
/>
)
: <Badge color='transparent' />