Skip to content

Commit

Permalink
feat(wallet-dashboard): remove extra memo.
Browse files Browse the repository at this point in the history
  • Loading branch information
panteleymonchuk committed Nov 1, 2024
1 parent 1d8887e commit a852fab
Showing 1 changed file with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export function StakedDetailsDialog({
// flag if the validator is at risk of being removed from the active set
const isAtRisk = system?.atRiskValidators.some((item) => item[0] === validatorAddress);

const validatorMeta = useMemo(() => {
const validatorSummary = useMemo(() => {
if (!system) return null;

return (
Expand All @@ -85,15 +85,10 @@ export function StakedDetailsDialog({
);
}, [validatorAddress, system]);

const validatorData = useMemo(() => {
if (!system) return null;
return system.activeValidators.find((av) => av.iotaAddress === validatorAddress);
}, [validatorAddress, system]);

const validatorName = validatorMeta?.name || '';
const stakingPoolActivationEpoch = Number(validatorMeta?.stakingPoolActivationEpoch || 0);
const validatorName = validatorSummary?.name || '';
const stakingPoolActivationEpoch = Number(validatorSummary?.stakingPoolActivationEpoch || 0);
const currentEpoch = Number(system?.epoch || 0);
const commission = validatorData ? Number(validatorData.commissionRate) / 100 : 0;
const commission = validatorSummary ? Number(validatorSummary.commissionRate) / 100 : 0;

// flag as new validator if the validator was activated in the last epoch
// for genesis validators, this will be false
Expand Down

0 comments on commit a852fab

Please sign in to comment.