Skip to content

Commit

Permalink
Merge pull request #122 from bnb-chain/wenty/solana
Browse files Browse the repository at this point in the history
fix: Fix token balance sorting issue
  • Loading branch information
wenty22 authored Nov 12, 2024
2 parents 1cb35e0 + bb4de20 commit 272f0ae
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,15 @@ export function sortTokens({
return 1;
}

if (a.balance && b.balance) {
const aBalance = Number(a.balance);
const bBalance = Number(b.balance);
if (aBalance && bBalance) {
return sortWithPredefinedOrders();
}
if (a.balance && !b.balance) {
if (aBalance && !bBalance) {
return -1;
}
if (!a.balance && b.balance) {
if (!aBalance && bBalance) {
return 1;
}
}
Expand Down

0 comments on commit 272f0ae

Please sign in to comment.