Issue with APP_INITIALIZER and NativeScript Theme: Core V2
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 30/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- À l'abandon
- Stack technique
- angular, typescript
- Domaine
- frontend, mobile-dev
Piste de recherche
Commencez par exécuter le projet d’exemple lié avec npm run android ou npm run ios, puis comparez le comportement avec et sans le fournisseur APP_INITIALIZER dans app.module.ts. Inspectez la configuration du thème référencée dans AppComponent et vérifiez que Theme.setMode() conserve le mode sélectionné ainsi que la valeur correcte de Application.systemAppearance() après le redémarrage de l’application.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Environment
- Node.js: v16
- Android SDK: 30
- JDK 11
- Xcode: 13.3.1
- CocoaPods 1.11.2
- CLI: latest
nativescript@8.2.2 - Cross-platform modules:
@nativescript/core@8.1.5 - Android Runtime:
@nativescript/android@8.1.1 - iOS Runtime:
@nativescript/ios@6.5.5(JSC!) - Angular:
@angular/core@13.2.5 - Plugin(s):
├── @nativescript/theme@3.0.2
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:
- Clone the sample project
- run
npm run androidornpm 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.
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?
- Langage dominant
- TypeScript
- Étoiles
- 55
- Forks
- 13
- Merge moyen
- 16 min
- PR mergées (30 j)
- 1
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de NativeScript/angular
-
Difficulté 4/5 3-5 jours Accessibilité débutants 45/100
NativeScript/angular#170 · 1 commentaire ·
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
NativeScript/angular#164 ·
-
My types are gone Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 45/100
NativeScript/angular#163 · 1 commentaire ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 38/100
NativeScript/angular#158 · 1 réaction ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 35/100
NativeScript/angular#155 ·
Toutes les issues de NativeScript/angular
Issues similaires
-
[Bug]: Discord Activity titles with emoji are rejected as over 80 characters when they are not Ouverteclawsweeper:linked-pr-open clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:message-loss issue-rating: 🦞 diamond lobster maturity:stable P2
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
Eynzof/Hermes-CN-Desktop#616 ·
-
ZCode 3.14.3 に対応する Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
supermomonga/zcode-acp#24 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
growthbook/growthbook#7100 ·
-
triage
Difficulté 1/5 1-3 heures Accessibilité débutants 88/100