Skip to content

Commit

Permalink
Merge branch 'fix-token-without-amount' into 'dev'
Browse files Browse the repository at this point in the history
Fix token without amount

See merge request ergo/minotaur/minotaur-wallet!44
  • Loading branch information
vorujack committed Dec 8, 2024
2 parents 59fbf77 + 2f6c089 commit dc54cef
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/mean-starfishes-retire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'minotaur-wallet': patch
---

Do not display token with amount equal to zero
8 changes: 7 additions & 1 deletion apps/wallet/src/store/reducer/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,13 @@ const updateAddressBalance = (
amount: '0',
};
address.balance = addressBalances.amount;
address.tokens = addressBalances.tokens;
address.tokens = addressBalances.tokens.filter(item => {
try{
return BigInt(item.balance) > 0n
}catch (e){
return false
}
});
};

const walletSlice = createSlice({
Expand Down

0 comments on commit dc54cef

Please sign in to comment.