Skip to content

Commit 342307f

Browse files
committed
fix: remove from prepareReady event when we really stop the livesync process
1 parent 943b3bd commit 342307f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/controllers/run-controller.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,6 @@ export class RunController extends EventEmitter implements IRunController {
7373
const { projectDir, deviceIdentifiers, stopOptions } = data;
7474
const liveSyncProcessInfo = this.$liveSyncProcessDataService.getPersistedData(projectDir);
7575
if (liveSyncProcessInfo && !liveSyncProcessInfo.isStopped) {
76-
if (this.prepareReadyEventHandler) {
77-
this.removeListener(PREPARE_READY_EVENT_NAME, this.prepareReadyEventHandler);
78-
this.prepareReadyEventHandler = null;
79-
}
8076

8177
// In case we are coming from error during livesync, the current action is the one that erred (but we are still executing it),
8278
// so we cannot await it as this will cause infinite loop.
@@ -114,6 +110,11 @@ export class RunController extends EventEmitter implements IRunController {
114110

115111
liveSyncProcessInfo.deviceDescriptors = [];
116112

113+
if (this.prepareReadyEventHandler) {
114+
this.removeListener(PREPARE_READY_EVENT_NAME, this.prepareReadyEventHandler);
115+
this.prepareReadyEventHandler = null;
116+
}
117+
117118
const projectData = this.$projectDataService.getProjectData(projectDir);
118119
await this.$hooksService.executeAfterHooks('watch', {
119120
hookArgs: {

0 commit comments

Comments
 (0)