fix(governance): filtered out nodes with 0 performance score from homepage list (#4267)

This commit is contained in:
Sam Keen 2023-07-19 13:32:57 +01:00 committed by GitHub
parent 071a6ff8bb
commit 29991015b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,6 +31,7 @@ import {
orderByDate,
orderByUpgradeBlockHeight,
} from '../proposals/components/proposals-list/proposals-list';
import { BigNumber } from '../../lib/bignumber';
const nodesToShow = 6;
@ -248,6 +249,8 @@ const GovernanceHome = ({ name }: RouteChildProps) => {
const activeNodes = removePaginationWrapper(
validatorsData?.nodesConnection.edges
).filter((node) =>
new BigNumber(node.rankingScore.performanceScore).isGreaterThan(0)
);
const trimmedActiveNodes = activeNodes?.slice(0, nodesToShow);