-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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: add contractBalances as dependency #12205
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Bitrise❌❌❌ Commit hash: e0489a5 Note
Tip
|
Quality Gate passedIssues Measures |
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.
LGTM
Description
This PR forces UI to rerender when contractBalances change in state.
When a user switches from account A to account B; the value of contractBalances would still have the state values from accountA;
If account A and accountB have some tokens in common (exp both hold USDC) you would see the total = native fiat value + USDC value;
Also; When a user switches accounts, the tokensStateChange subscription is fired; except that by the time it got to update the contractBalances in state; the UI has already rendered the total fiat value;
The reason why after a while, it would update to the correct total value; is because the conversionRate in state would change forcing the UI to re-render the component;
My fix here is adding contractBalances as a dependency which will force the array to rerender once contractBalances in state are updated;
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
Screen.Recording.2024-11-06.at.15.40.04.mov
After
Screen.Recording.2024-11-06.at.15.43.41.mov
Pre-merge author checklist
Pre-merge reviewer checklist