-
Notifications
You must be signed in to change notification settings - Fork 408
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: Harden condition for loading spending limits #3981
Conversation
Branch preview✅ Deploy successful! Storybook: |
I wonder what is the expected behaviour in case there are no tokens in a safe? Assuming |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
📦 Next.js Bundle Analysis for safe-wallet-webThis analysis was generated by the Next.js Bundle Analysis action. 🤖
|
Page | Size (compressed) |
---|---|
global |
1013.08 KB (🟡 +3 B) |
Details
The 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 <script>
tag are not accounted for in this analysis
If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!
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.
I think that this should get our RPC count significantly down as due to this we were doing the queries twice.
Coverage report
Test suite run success1442 tests passing in 199 suites. Report generated by 🧪jest coverage report action from b93849e |
@usame-algan I think the |
@schmanu I think that's fine because the purpose of that check is to verify that the balances are fetched from CGW. Looks like this hook is also re-run each time balances are polled... |
Spending limit looks fine Creation, edition, removal. LGTM |
What it solves
Part of #2414
How this PR fixes it
getSpendingLimits
was called twice because the condition only checked for the existence oftokenInfoFromBalances
but the initial value is an empty array so it should check the length of the array insteadHow to test it
Checklist