-
-
Notifications
You must be signed in to change notification settings - Fork 197
fix: preview shouldn't start native watch #5016
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
fix: preview shouldn't start native watch #5016
Conversation
test cli-smoke cli-preview cli-device |
02e7ca1
to
f763264
Compare
test cli-smoke cli-preview cli-device |
lib/data/prepare-data.ts
Outdated
if (_.isBoolean(data.watchNative)) { | ||
this.watchNative = data.watchNative; | ||
} | ||
this.watch = data.watch; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicated line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. :)
@@ -127,6 +127,21 @@ export class PrepareController extends EventEmitter { | |||
} | |||
|
|||
private async startNativeWatcherWithPrepare(platformData: IPlatformData, projectData: IProjectData, prepareData: IPrepareData): Promise<boolean> { | |||
let newWatchStarted = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
newWatchStarted
-> newNativeWatchStarted
test cli-smoke cli-preview cli-device |
PR Checklist
What is the current behavior?
When the user scans the preview barcode with both device platforms, the second one modifies the package.json to set the runtime version, which triggers a native change event. This causes an error as preview controller doesn't understand and shouldn't understand of native changes.
What is the new behavior?
Disable the native changes watch when running
tns preview
.Fixes/Implements/Closes #4893