Skip to content

Commit

Permalink
Show the tokens only if the token amount is greater than 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Thunnini committed Oct 16, 2020
1 parent 17b0946 commit 9a1d856
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ui/popup/pages/main/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 9a1d856

Please sign in to comment.