-
Notifications
You must be signed in to change notification settings - Fork 0
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 refresh balance on inFocus event #2734
base: main
Are you sure you want to change the base?
Conversation
Jest ReportSummary
Tests
Coverage (92%)
|
useFocusEffect( | ||
useCallback(() => { | ||
updateBalances() | ||
// eslint-disable-next-line react-hooks/exhaustive-deps |
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.
avoid this one, provide the updateBalances in deps array if do not create any issues on the behavior
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.
The problem is using updateBalances as the dependency creates a endless loop effect. That was the reason behind the ignoring pattern. wdyt?
Related Issue
Closes #
2646
Description of Changes
This PR fixes a bug allowing user's balance to get updated after coming from WebView/InApp Browser. This was first noticed when a user was claiming B3TR and getting back to main/home view. Balance wasn't updated automatically but triggered after forced updated (dragging down). Now balances get updated every time home screen gets backed to be in focus.
Reviewer(s)
@grenos @Doublemme @mfrezzati
UI/UX Changes
Screen.Recording.2025-02-26.at.10.07.30.mov
Checklist
Thank you for contributing! 🎉