From f4fa0bd25a6c2035678085ff8bd62fc8115cc908 Mon Sep 17 00:00:00 2001 From: Dexter Edwards Date: Thu, 22 Dec 2022 10:49:26 +0000 Subject: [PATCH] fix: flickering (#2445) * fix: flickering * Update apps/token/src/routes/staking/home/validator-tables/validator-tables.tsx --- .../home/validator-tables/consensus-validators-table.tsx | 3 +-- .../routes/staking/home/validator-tables/validator-tables.tsx | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/apps/token/src/routes/staking/home/validator-tables/consensus-validators-table.tsx b/apps/token/src/routes/staking/home/validator-tables/consensus-validators-table.tsx index 141b12d39..4119629ef 100644 --- a/apps/token/src/routes/staking/home/validator-tables/consensus-validators-table.tsx +++ b/apps/token/src/routes/staking/home/validator-tables/consensus-validators-table.tsx @@ -122,8 +122,7 @@ export const ConsensusValidatorsTable = ({ const gridRef = useRef(null); const nodes = useMemo(() => { - if (!data) return []; - + if (!data || !previousEpochData) return []; const canonisedNodes = data .sort((a, b) => { const aVotingPower = new BigNumber(a.rankingScore.votingPower); diff --git a/apps/token/src/routes/staking/home/validator-tables/validator-tables.tsx b/apps/token/src/routes/staking/home/validator-tables/validator-tables.tsx index 2a3820463..d76e2253c 100644 --- a/apps/token/src/routes/staking/home/validator-tables/validator-tables.tsx +++ b/apps/token/src/routes/staking/home/validator-tables/validator-tables.tsx @@ -59,7 +59,6 @@ export const ValidatorTables = ({ case Schema.ValidatorStatus.VALIDATOR_NODE_STATUS_PENDING: acc.pendingValidators.push(validator); } - return acc; }, { @@ -95,7 +94,6 @@ export const ValidatorTables = ({ 2 ).toString(); } - return (
{consensusValidators.length > 0 && (