Skip to content

Commit

Permalink
Add isStatic support to useRawLogs hook
Browse files Browse the repository at this point in the history
  • Loading branch information
dimlbc committed Jul 11, 2023
1 parent 01ed172 commit a94082b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/core/src/hooks/useRawLogs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@ export function useRawLogs(

const [logs, setLogs] = useState<Log[] | undefined>()

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() {
Expand Down

0 comments on commit a94082b

Please sign in to comment.