From 98aa69617250a86f3cd854c518cf8b15dd7aea98 Mon Sep 17 00:00:00 2001 From: vorujack Date: Sun, 8 Dec 2024 13:40:09 +0330 Subject: [PATCH 1/2] remove token without amount --- apps/wallet/src/store/reducer/wallet.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/wallet/src/store/reducer/wallet.ts b/apps/wallet/src/store/reducer/wallet.ts index ef06aa7..341ff46 100644 --- a/apps/wallet/src/store/reducer/wallet.ts +++ b/apps/wallet/src/store/reducer/wallet.ts @@ -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({ From 2f6c0897875f78b213c52f7f129d001bc2e4eb11 Mon Sep 17 00:00:00 2001 From: vorujack Date: Sun, 8 Dec 2024 13:40:51 +0330 Subject: [PATCH 2/2] add changeset --- .changeset/mean-starfishes-retire.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/mean-starfishes-retire.md diff --git a/.changeset/mean-starfishes-retire.md b/.changeset/mean-starfishes-retire.md new file mode 100644 index 0000000..6dd5885 --- /dev/null +++ b/.changeset/mean-starfishes-retire.md @@ -0,0 +1,5 @@ +--- +'minotaur-wallet': patch +--- + +Do not display token with amount equal to zero