Skip to content
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

appCommon is not defined when resetting to auto mode. #280

Open
jamescodesthings opened this issue Oct 20, 2020 · 0 comments · May be fixed by #281
Open

appCommon is not defined when resetting to auto mode. #280

jamescodesthings opened this issue Oct 20, 2020 · 0 comments · May be fixed by #281

Comments

@jamescodesthings
Copy link

@jamescodesthings jamescodesthings commented Oct 20, 2020

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

├── nativescript@7.0.10
├── @nativescript/android@7.0.0
├── @nativescript/angular@10.1.7
├── @nativescript/ios@7.0.3
├── @nativescript/theme@3.0.0

Describe the bug
When calling Theme.setMode(Theme.Auto) I receive the following error in both Android and iOS:

JS: Stacktrace: ReferenceError: appCommon is not defined
JS:     at Function.setMode (file: node_modules/@nativescript/theme/index.js:55:0)
...

I think the issue is:

// Reset to Auto system theme
setTimeout(appCommon.systemAppearanceChanged.bind(this, Theme.rootView, Application.systemAppearance()));

// Should be
setTimeout(Application.systemAppearanceChanged.bind(this, Theme.rootView, Application.systemAppearance()));

Will open PR.

To Reproduce
Call Theme.setMode(Theme.Auto);. Have checked in @nativescript/theme@3.0.0 and @nativescript/theme@2.5.0.

Expected behavior
Theme.setMode(Theme.Auto) Resets theme to system default.

Additional context
N/A

jamescodesthings added a commit to jamescodesthings/theme that referenced this issue Oct 20, 2020
Fixes NativeScript#280 it looks like at some point this might have been changed from appCommon to Application and this reference missed.
@jamescodesthings jamescodesthings linked a pull request that will close this issue Oct 20, 2020
5 of 5 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

1 participant
You can’t perform that action at this time.