Skip to content

Commit 816a33a

Browse files
authored
fix(staking): fix sorting by quality ranking when ranking is 0 (#1936)
1 parent 75781f8 commit 816a33a

File tree

1 file changed

+10
-2
lines changed
  • apps/staking/src/components/OracleIntegrityStaking

1 file changed

+10
-2
lines changed

apps/staking/src/components/OracleIntegrityStaking/index.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,15 @@ const doSort = (
804804
return value === 0 ? Number(a.poolCapacity - b.poolCapacity) : value;
805805
}
806806
case SortField.QualityRanking: {
807-
return Number(a.qualityRanking - b.qualityRanking);
807+
if (a.qualityRanking === 0 && b.qualityRanking === 0) {
808+
return 0;
809+
} else if (a.qualityRanking === 0) {
810+
return 1;
811+
} else if (b.qualityRanking === 0) {
812+
return -1;
813+
} else {
814+
return Number(a.qualityRanking - b.qualityRanking);
815+
}
808816
}
809817
case SortField.SelfStake: {
810818
return Number(a.selfStake - b.selfStake);
@@ -1029,7 +1037,7 @@ const Publisher = ({
10291037
{publisher.numFeeds}
10301038
</PublisherTableCell>
10311039
<PublisherTableCell className="text-center">
1032-
{publisher.qualityRanking}
1040+
{publisher.qualityRanking === 0 ? "-" : publisher.qualityRanking}
10331041
</PublisherTableCell>
10341042
<PublisherTableCell
10351043
className={clsx("text-right", { "pr-4 sm:pr-10": !isSelf })}

0 commit comments

Comments
 (0)