You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
run npm run android or npm run ios (the home component will show some theme/system appearance details)
tap "Change app theme" and choose the opposite theme to your current device setting, the theme changes correctly for now, but Problem 1: as you can see Application.systemAppearance() now shows a wrong value (e.g. "dark", even if the device is in light mode)
Close the app (not only put it to background)
Restart the app ... Problem 2: The app theme is back to auto, although it is set to a specific mode in the AppComponent
But if you disable the APP_INITIALIZER by removing the APP_INITIALIZER from the providers array in app.module.ts everything is working just fine.
Expected behavior
Theme.setMode() is working despite the use of APP_INITIALIZER.
Environment
[email protected]
@nativescript/[email protected]
@nativescript/[email protected]
@nativescript/[email protected]
(JSC!)@angular/[email protected]
├── @nativescript/[email protected]
Describe the bug
The Theme.setMode() from the NativeScript Theme plugin stops working when an async APP_INITIALIZER is used.
To Reproduce
Steps to reproduce:
npm run android
ornpm run ios
(the home component will show some theme/system appearance details)Problem 1: as you can see Application.systemAppearance() now shows a wrong value (e.g. "dark", even if the device is in light mode)
Problem 2: The app theme is back to auto, although it is set to a specific mode in the AppComponent
But if you disable the APP_INITIALIZER by removing the APP_INITIALIZER from the providers array in app.module.ts everything is working just fine.
Expected behavior
Theme.setMode() is working despite the use of APP_INITIALIZER.
Sample project
https://github.com/jessorlisa/demo-issues-nativescript-ng/tree/issue/set-theme
Additional context
My first suspicion was that something was amiss with the theme but then I could narrow it down to the APP_INITIALIZER.
Any thoughts? Help?
The text was updated successfully, but these errors were encountered: