fix: Sort token accounts by balances (#42)

This commit is contained in:
Armani Ferrante 2021-06-11 16:21:51 -07:00 committed by GitHub
parent edbc600b84
commit 1886a484cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -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",

View File

@ -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
);