Issue with APP_INITIALIZER and NativeScript Theme: Core V2
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 30/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- angular, typescript
- Lĩnh vực
- frontend, mobile-dev
Hướng nghiên cứu
Bắt đầu bằng cách chạy dự án mẫu được liên kết với npm run android hoặc npm run ios, sau đó so sánh hành vi khi có và không có provider APP_INITIALIZER trong app.module.ts. Kiểm tra cấu hình theme được tham chiếu trong AppComponent và xác minh rằng Theme.setMode() giữ nguyên mode đã chọn và giá trị chính xác của Application.systemAppearance() sau khi khởi động lại ứng dụng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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?
- Ngôn ngữ chính
- TypeScript
- Star
- 55
- Fork
- 13
- Merge trung bình
- 16 phút
- Pull request đã merge (30 ngày)
- 1
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của NativeScript/angular
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
NativeScript/angular#170 · 1 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
NativeScript/angular#164 ·
-
My types are gone Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
NativeScript/angular#163 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
NativeScript/angular#158 · 1 reaction ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
NativeScript/angular#155 ·
Tất cả issue của NativeScript/angular
Issue tương tự
-
[Bug]: Discord Activity titles with emoji are rejected as over 80 characters when they are not Đang mởclawsweeper:linked-pr-open clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:message-loss issue-rating: 🦞 diamond lobster maturity:stable P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Eynzof/Hermes-CN-Desktop#616 ·
-
ZCode 3.14.3 に対応する Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
supermomonga/zcode-acp#24 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
growthbook/growthbook#7100 ·
-
triage
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100