From a94082b9bd60802900cf4a026be9d388e01dd68f Mon Sep 17 00:00:00 2001 From: Dmitry Lobachevsky Date: Tue, 11 Jul 2023 20:08:01 +0300 Subject: [PATCH] Add isStatic support to useRawLogs hook --- packages/core/src/hooks/useRawLogs.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/core/src/hooks/useRawLogs.ts b/packages/core/src/hooks/useRawLogs.ts index d311f8210..164f1374e 100644 --- a/packages/core/src/hooks/useRawLogs.ts +++ b/packages/core/src/hooks/useRawLogs.ts @@ -26,11 +26,14 @@ export function useRawLogs( const [logs, setLogs] = useState() - const { chainId } = queryParams + const { chainId, isStatic } = queryParams const [provider, blockNumber] = useMemo( - () => (chainId ? [providers[chainId], blockNumbers[chainId]] : [library, _blockNumber]), - [providers, library, blockNumbers, _blockNumber, chainId] + () => + chainId + ? [providers[chainId], isStatic ? undefined : blockNumbers[chainId]] + : [library, isStatic ? undefined : _blockNumber], + [chainId, providers, isStatic, blockNumbers, library, _blockNumber] ) async function updateLogs() {