From 7ad7938ca8944f5c393ef759ce57d3bbcaa6d28b Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Thu, 15 Aug 2024 17:18:35 +0200 Subject: [PATCH] Fix warning --- .../src/utils/tinlake/useTinlakePools.ts | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/centrifuge-app/src/utils/tinlake/useTinlakePools.ts b/centrifuge-app/src/utils/tinlake/useTinlakePools.ts index 65831a6d5..13071a205 100644 --- a/centrifuge-app/src/utils/tinlake/useTinlakePools.ts +++ b/centrifuge-app/src/utils/tinlake/useTinlakePools.ts @@ -134,19 +134,21 @@ export function useIpfsPools(suspense = false) { export function useTinlakePools(suspense = false) { const ipfsPools = useIpfsPools(suspense) - if (ethConfig.network !== 'mainnet') { - return useQuery(['tinlakePools', !!ipfsPools], () => [] as any as { pools: TinlakePool[] }, { + return useQuery( + ['tinlakePools', !!ipfsPools], + () => { + if (ethConfig.network !== 'mainnet') { + return [] as any as { pools: TinlakePool[] } + } + + return getPools(ipfsPools!) + }, + { enabled: !!ipfsPools, staleTime: Infinity, suspense, - }) - } - - return useQuery(['tinlakePools', !!ipfsPools], () => getPools(ipfsPools!), { - enabled: !!ipfsPools, - staleTime: Infinity, - suspense, - }) + } + ) } export function useTinlakeLoans(poolId: string) { const tinlakePools = useTinlakePools(poolId.startsWith('0x'))