diff --git a/src/components/modals/GIVdropHarvestModal.tsx b/src/components/modals/GIVdropHarvestModal.tsx index 46d0e5681b..f0ed5d0db5 100644 --- a/src/components/modals/GIVdropHarvestModal.tsx +++ b/src/components/modals/GIVdropHarvestModal.tsx @@ -90,7 +90,7 @@ export const GIVdropHarvestModal: FC = ({ const chainId = chain?.id; const sdh = new SubgraphDataHelper(currentValues.data); const givTokenDistroBalance = sdh.getGIVTokenDistroBalance(); - const { data: givPrice } = useFetchGIVPrice(chainId); + const { data: givPrice } = useFetchGIVPrice(); useEffect(() => { const bnGIVback = BigInt(givTokenDistroBalance.givback); diff --git a/src/hooks/useGivPrice.tsx b/src/hooks/useGivPrice.tsx index f90e944293..b0153d89de 100644 --- a/src/hooks/useGivPrice.tsx +++ b/src/hooks/useGivPrice.tsx @@ -2,8 +2,8 @@ import { useQuery } from '@tanstack/react-query'; import config from '@/configuration'; import { fetchGnosisTokenPrices } from '@/services/token'; -export const useFetchGIVPrice = (chainId?: number) => { - const _chainId = chainId || config.GNOSIS_NETWORK_NUMBER; +export const useFetchGIVPrice = () => { + const _chainId = config.GNOSIS_NETWORK_NUMBER; const tokenAddress = config.EVM_NETWORKS_CONFIG[_chainId]?.tokenAddressOnUniswapV2; return useQuery({ diff --git a/src/hooks/useTokenPrice.tsx b/src/hooks/useTokenPrice.tsx index 91efa2286c..18d2d351cd 100644 --- a/src/hooks/useTokenPrice.tsx +++ b/src/hooks/useTokenPrice.tsx @@ -32,7 +32,7 @@ export const useTokenPrice = (token?: ITokenPrice) => { const { walletChainType } = useGeneralWallet(); const { chain } = useAccount(); const chainId = chain?.id; - const { data: givPrice } = useFetchGIVPrice(chainId); + const { data: givPrice } = useFetchGIVPrice(); const givTokenPrice = givPrice ? new BigNumber(givPrice).toNumber() : 0; const isMainnet = chainId === config.MAINNET_NETWORK_NUMBER; @@ -44,8 +44,8 @@ export const useTokenPrice = (token?: ITokenPrice) => { stableCoins.includes(token.symbol.toUpperCase())) ) { setTokenPrice(1); - } else if (token?.symbol === 'GIV') { - setTokenPrice(givTokenPrice || 0); + } else if (token?.symbol === 'GIV' && givTokenPrice) { + setTokenPrice(givTokenPrice); } else if (token?.coingeckoId) { setTokenPrice( (await fetchPriceWithCoingeckoId(token.coingeckoId)) || 0,