Skip to content

Commit

Permalink
fix: state deps
Browse files Browse the repository at this point in the history
  • Loading branch information
grothem committed Dec 20, 2024
1 parent 83162c0 commit 51a58fd
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/modules/reserve-overview/ReserveActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import { CapType } from '../../components/caps/helper';
import { AvailableTooltip } from '../../components/infoTooltips/AvailableTooltip';
import { Link, ROUTES } from '../../components/primitives/Link';
import { useReserveActionState } from '../../hooks/useReserveActionState';
import { useShallow } from 'zustand/shallow';

const amountToUSD = (
amount: BigNumberValue,
Expand All @@ -55,20 +56,22 @@ export const ReserveActions = ({ reserve }: ReserveActionsProps) => {

const { currentAccount } = useWeb3Context();
const { openBorrow, openSupply } = useModalContext();
const currentMarket = useRootStore((store) => store.currentMarket);
const currentNetworkConfig = useRootStore((store) => store.currentNetworkConfig);
const currentMarketData = useRootStore((store) => store.currentMarketData);
const [currentMarket, currentNetworkConfig, currentMarketData, minRemainingBaseTokenBalance] =
useRootStore(
useShallow((store) => [
store.currentMarket,
store.currentNetworkConfig,
store.currentMarketData,
store.poolComputed.minRemainingBaseTokenBalance,
])
);
const {
ghoReserveData,
user,
loading: loadingReserves,
marketReferencePriceInUsd,
} = useAppDataContext();
const { walletBalances, loading: loadingWalletBalance } = useWalletBalances(currentMarketData);

const [minRemainingBaseTokenBalance] = useRootStore((store) => [
store.poolComputed.minRemainingBaseTokenBalance,
]);
const { baseAssetSymbol } = currentNetworkConfig;
let balance = walletBalances[reserve.underlyingAsset];
if (reserve.isWrappedBaseAsset && selectedAsset === baseAssetSymbol) {
Expand Down

0 comments on commit 51a58fd

Please sign in to comment.