-
Notifications
You must be signed in to change notification settings - Fork 12
fix: improve caching of useWatchWhenVisible #3305
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
base: master
Are you sure you want to change the base?
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.
Pull request overview
This PR aims to improve caching in the useWatchWhenVisible hook to prevent UI flickering when providers reinitialize after being inactive. The changes add logic to retain cached AsyncValue data when the provider briefly returns loading or null states during reinitialization. Additionally, it includes UI improvements to the tokenized community page.
Changes:
- Enhanced
useWatchWhenVisiblehook with smart caching logic to avoid showing degraded states (loading/null) when returning to a visible route - Excluded twitter tokens from showing duplicate titles in the header
- Added text overflow handling and removed conditional padding for better UI consistency
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| lib/app/hooks/use_watch_when_visible.dart | Added AsyncValue-aware caching logic to preserve last good state during provider reinitialization, preventing flickering |
| lib/app/features/tokenized_communities/views/pages/tokenized_community_page.dart | Excluded twitter token type from title display, added ellipsis for overflow protection, and removed conditional padding for consistency |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Pull Request is not mergeable
5bfccd5
c046f87 to
5bfccd5
Compare
5bfccd5 to
152cec2
Compare
Description
useWatchWhenVisibleto avoid flickering of the statesTask ID
ION-5434
ION-5419
Type of Change