1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-11-15 01:34:57 +01:00

effect dependency fix (#578)

This commit is contained in:
Matthias Kretschmann 2021-05-05 11:43:09 +02:00 committed by GitHub
parent 49cd032274
commit 6cc268bd3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,6 +77,7 @@ export function useGraphSyncStatus(): UseGraphSyncStatus {
// Get and set subgraph block
useEffect(() => {
if (!config || !config.subgraphUri) return
async function initBlockSubgraph() {
setSubgraphLoading(true)
const blockGraph = await getBlockSubgraph(config.subgraphUri)
@ -98,7 +99,7 @@ export function useGraphSyncStatus(): UseGraphSyncStatus {
return
}
setIsGraphSynced(true)
}, [blockGraph, blockHead])
}, [blockGraph, blockHead, web3Loading, subgraphLoading])
return { blockHead, blockGraph, isGraphSynced }
}