Skip to content

Commit

Permalink
Fix warning
Browse files Browse the repository at this point in the history
  • Loading branch information
hieronx committed Aug 15, 2024
1 parent aced105 commit 7ad7938
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions centrifuge-app/src/utils/tinlake/useTinlakePools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down

0 comments on commit 7ad7938

Please sign in to comment.