Skip to content

Commit

Permalink
fix: hide loader when hash is null
Browse files Browse the repository at this point in the history
  • Loading branch information
vien.nguyen2-tiki committed Feb 22, 2023
1 parent 50f63ca commit 6832361
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions views/transactions/hook/useInternalTransactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { CryptoIconNames } from '@astraprotocol/astra-ui/lib/es/components/Crypt
import API_LIST from 'api/api_list'
import { formatEther } from 'ethers/lib/utils'
import useDelayUntilDone from 'hooks/useDelayUntilDone'
import { isEmpty } from 'lodash'
import { useCallback } from 'react'
import useSWR from 'swr'
import { evmInternalTransactionType } from 'utils/evm'
Expand All @@ -17,9 +16,11 @@ export default function useInternalTransactions({ hash }: { hash: string }) {
refreshInterval: 0
})

console.log({ data })

const isLoadedData = useCallback(() => {
return !isEmpty(data) || error
}, [data, error])
return !!data || !!error || !hash
}, [data, error, hash])

const { isWaiting } = useDelayUntilDone(isLoadedData)

Expand Down

0 comments on commit 6832361

Please sign in to comment.