-
Notifications
You must be signed in to change notification settings - Fork 850
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: useScaffoldEventHistory caching #916
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh I think the main underlying problem was I missed adding filters
in queryKey
:
scaffold-eth-2/packages/nextjs/hooks/scaffold-eth/useScaffoldEventHistory.ts
Lines 100 to 108 in a132cce
queryKey: [ | |
"eventHistory", | |
{ | |
contractName, | |
address: deployedContractData?.address, | |
eventName, | |
fromBlock: fromBlock.toString(), | |
chainId: targetNetwork.id, | |
}, |
Since we didn't had filters
in query key react-query
was treating both queries as same and hence not respecting the filters provided.
This reverts commit 7364335.
Can't approve my own PR 😄 . Thank you for update, lgtm! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merging this 🙌
Description
Fixes useScaffoldEventHistory caching
Fixes #903
Additional Information