-
Notifications
You must be signed in to change notification settings - Fork 38
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#945 - Dark Mode Reverts to Light Mode After Refresh #948
base: andrew_testing
Are you sure you want to change the base?
FIX#945 - Dark Mode Reverts to Light Mode After Refresh #948
Conversation
Deploying packrat with Cloudflare Pages
|
❌ Tests failed for this pull request. 😞 |
Android APK build completed! |
@awais-codes hi! upon refreshing the page, it flashes the light mode before switching back to dark mode. Please take a look at the screen recording below. Thanks! Screen.Recording.2024-05-18.at.10.16.01.mov |
it should be fix with the recent commit. @JewelTee can you check please? |
@awais-codes The Issue persists Screen.Recording.2024-05-18.at.10.16.01.mov |
a06f620
to
af07442
Compare
@JewelTee I was trying to re-use an existing hook "useStorage" in respect of the DRY principle. But that hook does event driven asynchronous updates to localStorage. Now I am utilizing plain localStorage object. it should be fixed now. Recording is attached. screen-capture.2.webm |
@awais-codes thanks for the update, the issue is now fixed! |
packages/app/context/theme.tsx
Outdated
* Initializes the app theme based on the stored theme preference. | ||
*/ | ||
useLayoutEffect(() => { | ||
const themeModePreference = localStorage.getItem('theme') as ThemeMode; |
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.
this needs to run through Async storage to avoid error on native side
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.
doing so results in a flashed theme update on the first render.
af07442
to
38b2b33
Compare
Fix for Issue#945