FIX#945 - Dark Mode Reverts to Light Mode After Refresh#948
FIX#945 - Dark Mode Reverts to Light Mode After Refresh#948awais-codes wants to merge 3 commits intoandrew_testingfrom
Conversation
Deploying packrat with
|
| Latest commit: |
38b2b33
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://97efdd85.packrat.pages.dev |
| Branch Preview URL: | https://fix-945-fix-theme-persistanc.packrat.pages.dev |
|
❌ 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.
this needs to run through Async storage to avoid error on native side
There was a problem hiding this comment.
doing so results in a flashed theme update on the first render.
af07442 to
38b2b33
Compare
Fix for Issue#945