Skip to content

Commit 9629f78

Browse files
author
Dimitar Kerezov
committed
Fix PR Comments II
1 parent c4f0209 commit 9629f78

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

lib/services/debug-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class DebugService extends EventEmitter implements IDebugService {
2929
this.$errors.failWithoutHelp(`The application ${debugData.applicationIdentifier} is not installed on device with identifier ${debugData.deviceIdentifier}.`);
3030
}
3131

32-
const debugOptions: IDebugOptions = _.merge({}, options);
32+
const debugOptions: IDebugOptions = _.cloneDeep(options);
3333

3434
// TODO: Check if app is running.
3535
// For now we can only check if app is running on Android.

lib/services/livesync/livesync-service.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
102102
}
103103

104104
private async refreshApplication(projectData: IProjectData, liveSyncResultInfo: ILiveSyncResultInfo, debugOpts?: IDebugOptions, outputPath?: string): Promise<void> {
105-
const liveSyncProcessInfo = this.liveSyncProcessesInfo[projectData.projectDir];
106-
const deviceDescriptor = _.find(liveSyncProcessInfo.deviceDescriptors, dd => dd.identifier === liveSyncResultInfo.deviceAppData.device.deviceInfo.identifier);
105+
const deviceDescriptor = this.getDeviceDescriptor(liveSyncResultInfo.deviceAppData.device.deviceInfo.identifier, projectData.projectDir);
106+
107107
return deviceDescriptor && deviceDescriptor.debugggingEnabled ?
108108
this.refreshApplicationWithDebug(projectData, liveSyncResultInfo, debugOpts, outputPath) :
109109
this.refreshApplicationWithoutDebug(projectData, liveSyncResultInfo, debugOpts, outputPath);
@@ -118,13 +118,13 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
118118
const msg = `Unable to start application ${projectData.projectId} on device ${liveSyncResultInfo.deviceAppData.device.deviceInfo.identifier}. Try starting it manually.`;
119119
this.$logger.warn(msg);
120120
if (!settings || !settings.shouldSkipEmitLiveSyncNotification) {
121-
this.emit(LiveSyncEvents.liveSyncNotification, {
122-
projectDir: projectData.projectDir,
123-
applicationIdentifier: projectData.projectId,
124-
deviceIdentifier: liveSyncResultInfo.deviceAppData.device.deviceInfo.identifier,
125-
notification: msg
126-
});
127-
}
121+
this.emit(LiveSyncEvents.liveSyncNotification, {
122+
projectDir: projectData.projectDir,
123+
applicationIdentifier: projectData.projectId,
124+
deviceIdentifier: liveSyncResultInfo.deviceAppData.device.deviceInfo.identifier,
125+
notification: msg
126+
});
127+
}
128128
}
129129

130130
this.emit(LiveSyncEvents.liveSyncExecuted, {
@@ -228,9 +228,9 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
228228
}
229229

230230
private getDeviceDescriptor(deviceIdentifier: string, projectDir: string) {
231-
const liveSyncProcessInfo: ILiveSyncProcessInfo = this.liveSyncProcessesInfo[projectDir] || <ILiveSyncProcessInfo>{};
231+
const deviceDescriptors = this.getLiveSyncDeviceDescriptors(projectDir);
232232

233-
return _.find(liveSyncProcessInfo.deviceDescriptors, d => d.identifier === deviceIdentifier);
233+
return _.find(deviceDescriptors, d => d.identifier === deviceIdentifier);
234234
}
235235

236236
private async enableDebuggingCoreWithoutWaitingCurrentAction(deviceOption: IEnableDebuggingDeviceOptions, debuggingAdditionalOptions: IDebuggingAdditionalOptions): Promise<void> {

0 commit comments

Comments
 (0)