Skip to content

Commit

Permalink
Fix PR Comments II
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimitar Kerezov committed Aug 22, 2017
1 parent c4f0209 commit 9629f78
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/services/debug-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class DebugService extends EventEmitter implements IDebugService {
this.$errors.failWithoutHelp(`The application ${debugData.applicationIdentifier} is not installed on device with identifier ${debugData.deviceIdentifier}.`);
}

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

// TODO: Check if app is running.
// For now we can only check if app is running on Android.
Expand Down
22 changes: 11 additions & 11 deletions lib/services/livesync/livesync-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
}

private async refreshApplication(projectData: IProjectData, liveSyncResultInfo: ILiveSyncResultInfo, debugOpts?: IDebugOptions, outputPath?: string): Promise<void> {
const liveSyncProcessInfo = this.liveSyncProcessesInfo[projectData.projectDir];
const deviceDescriptor = _.find(liveSyncProcessInfo.deviceDescriptors, dd => dd.identifier === liveSyncResultInfo.deviceAppData.device.deviceInfo.identifier);
const deviceDescriptor = this.getDeviceDescriptor(liveSyncResultInfo.deviceAppData.device.deviceInfo.identifier, projectData.projectDir);

return deviceDescriptor && deviceDescriptor.debugggingEnabled ?
this.refreshApplicationWithDebug(projectData, liveSyncResultInfo, debugOpts, outputPath) :
this.refreshApplicationWithoutDebug(projectData, liveSyncResultInfo, debugOpts, outputPath);
Expand All @@ -118,13 +118,13 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
const msg = `Unable to start application ${projectData.projectId} on device ${liveSyncResultInfo.deviceAppData.device.deviceInfo.identifier}. Try starting it manually.`;
this.$logger.warn(msg);
if (!settings || !settings.shouldSkipEmitLiveSyncNotification) {
this.emit(LiveSyncEvents.liveSyncNotification, {
projectDir: projectData.projectDir,
applicationIdentifier: projectData.projectId,
deviceIdentifier: liveSyncResultInfo.deviceAppData.device.deviceInfo.identifier,
notification: msg
});
}
this.emit(LiveSyncEvents.liveSyncNotification, {
projectDir: projectData.projectDir,
applicationIdentifier: projectData.projectId,
deviceIdentifier: liveSyncResultInfo.deviceAppData.device.deviceInfo.identifier,
notification: msg
});
}
}

this.emit(LiveSyncEvents.liveSyncExecuted, {
Expand Down Expand Up @@ -228,9 +228,9 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
}

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

return _.find(liveSyncProcessInfo.deviceDescriptors, d => d.identifier === deviceIdentifier);
return _.find(deviceDescriptors, d => d.identifier === deviceIdentifier);
}

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

0 comments on commit 9629f78

Please sign in to comment.