Skip to content

Commit

Permalink
fix(core): fixed hang issue on click of denomination currency (#4072)
Browse files Browse the repository at this point in the history
  • Loading branch information
fullstackninja864 authored Oct 18, 2023
1 parent 83da03e commit 8b61b2f
Showing 1 changed file with 2 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
import { useSelector } from "react-redux";
import BigNumber from "bignumber.js";
import { RootState } from "@store";
import {
WalletToken,
dexPricesSelectorByDenomination,
tokensSelector,
} from "@waveshq/walletkit-ui/dist/store";
import { WalletToken, tokensSelector } from "@waveshq/walletkit-ui/dist/store";
import { useMemo } from "react";
import { DomainType } from "@contexts/DomainContext";
import { useDenominationCurrency } from "./PortfolioCurrency";
import { useEvmTokenBalances } from "./EvmTokenBalances";

export interface DomainToken {
Expand All @@ -30,14 +25,9 @@ export function useTokenBalance(): {
dvmTokens: DomainToken[];
evmTokens: DomainToken[];
} {
const { denominationCurrency } = useDenominationCurrency();

const tokens = useSelector((state: RootState) =>
tokensSelector(state.wallet),
);
const prices = useSelector((state: RootState) =>
dexPricesSelectorByDenomination(state.wallet, denominationCurrency),
);

const { evmTokens } = useEvmTokenBalances();
const mapDomainToken = (token: WalletToken) => {
Expand Down Expand Up @@ -94,7 +84,7 @@ export function useTokenBalance(): {
dvmTokens: [],
},
);
}, [prices, tokens]);
}, [tokens]);

return {
dvmTokens,
Expand Down

0 comments on commit 8b61b2f

Please sign in to comment.