fix: Sort token accounts by balances (#42)
This commit is contained in:
parent
edbc600b84
commit
1886a484cb
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@project-serum/swap-ui",
|
||||
"version": "0.1.2",
|
||||
"version": "0.1.3",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"homepage": "https://github.com/project-serum/swap-ui",
|
||||
|
|
|
@ -69,9 +69,9 @@ export function useOwnedTokenAccount(
|
|||
|
||||
// Take the account with the most tokens in it.
|
||||
tokenAccounts.sort((a, b) =>
|
||||
a.account.amount < b.account.amount
|
||||
a.account.amount > b.account.amount
|
||||
? -1
|
||||
: a.account.amount > b.account.amount
|
||||
: a.account.amount < b.account.amount
|
||||
? 1
|
||||
: 0
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue