-
Notifications
You must be signed in to change notification settings - Fork 464
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: Refetch owned safes after deployment #4673
Conversation
Branch preview✅ Deploy successful! Storybook: |
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.
Code review by ChatGPT
@@ -59,7 +69,7 @@ const usePendingSafeNotifications = (): void => { | |||
return () => { | |||
unsubFns.forEach((unsub) => unsub()) | |||
} | |||
}, [dispatch, safeAddress, chain]) | |||
}, [dispatch, safeAddress, chain, refetch]) | |||
} | |||
|
|||
export default usePendingSafeNotifications |
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.
-
Unnecessarily destructuring
address
with a default value of an empty string inuseWallet()
. EnsureuseWallet()
provides a consistent object structure. -
Dependencies for
useEffect
revised correctly, but consider removing the inlineif
condition for clarity:const skipTokenCondition = address === ''
. -
Consider moving the logic from
useEffect
outside to maintain its primary role of side-effect management and prevent excess logic within the hook.
const { address = '' } = useWallet() || {} | ||
const { refetch } = useGetAllOwnedSafesQuery(address === '' ? skipToken : { walletAddress: address }) |
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.
Its probably cleaner to create a new listener middleware for this. Wdyt @katspaugh @compojoom
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.
Although it does require access to the connected wallet which I am not sure is possible inside a middleware. We would have to move the connected wallet state into Redux as well.
📦 Next.js Bundle Analysis for safe-wallet-webThis analysis was generated by the Next.js Bundle Analysis action. 🤖 🎉 Global Bundle Size Decreased
DetailsThe global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster. Any third party scripts you have added directly to your app using the If you want further insight into what is behind the changes, give @next/bundle-analyzer a try! |
Coverage report
Test suite run success1707 tests passing in 231 suites. Report generated by 🧪jest coverage report action from 7441dcc |
What it solves
Fixes issue found in the release
How this PR fixes it
refetch
on the RTK query for all owned safes when receiving aSafeCreationEvent.INDEXED
How to test it
Checklist