From 6cc268bd3fac39dd6afe25403c7aa964574f5ba8 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Wed, 5 May 2021 11:43:09 +0200 Subject: [PATCH] effect dependency fix (#578) --- src/hooks/useGraphSyncStatus.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hooks/useGraphSyncStatus.ts b/src/hooks/useGraphSyncStatus.ts index a4e151656..acc2036e2 100644 --- a/src/hooks/useGraphSyncStatus.ts +++ b/src/hooks/useGraphSyncStatus.ts @@ -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 } }