From 9a1d8560cee4c121d316ab26228aa186b148cc16 Mon Sep 17 00:00:00 2001 From: Thunnini Date: Sat, 17 Oct 2020 04:06:17 +0900 Subject: [PATCH] Show the tokens only if the token amount is greater than 0 --- src/ui/popup/pages/main/index.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ui/popup/pages/main/index.tsx b/src/ui/popup/pages/main/index.tsx index 5e0e03eb8f..88ce72ccbb 100644 --- a/src/ui/popup/pages/main/index.tsx +++ b/src/ui/popup/pages/main/index.tsx @@ -19,6 +19,7 @@ import { ChainsKeeper } from "../../../../background/chains/keeper"; import { useConfirm } from "../../../components/confirm"; import { useIntl } from "react-intl"; import { TokensView } from "./token"; +import { Int } from "@chainapsis/cosmosjs/common/int"; export const MainPage: FunctionComponent = observer(() => { const history = useHistory(); @@ -60,7 +61,10 @@ export const MainPage: FunctionComponent = observer(() => { const stakeCurrency = chainStore.chainInfo.stakeCurrency; const tokens = accountStore.assets.filter(asset => { - return asset.denom !== stakeCurrency.coinMinimalDenom; + return ( + asset.denom !== stakeCurrency.coinMinimalDenom && + asset.amount.gt(new Int(0)) + ); }); const hasTokens = tokens.length > 0;