From 59ccd8f485500e5b2d29de09a581f8fd082edba9 Mon Sep 17 00:00:00 2001 From: DimitarTachev Date: Fri, 4 Jan 2019 19:01:24 +0200 Subject: [PATCH] fix: require user interaction for developer disk image only in debug --- lib/definitions/livesync.d.ts | 6 ++---- lib/services/livesync/livesync-service.ts | 8 +++++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/definitions/livesync.d.ts b/lib/definitions/livesync.d.ts index 0d2ad574e8..a4274c147a 100644 --- a/lib/definitions/livesync.d.ts +++ b/lib/definitions/livesync.d.ts @@ -330,11 +330,9 @@ interface IEnableDebuggingDeviceOptions extends Mobile.IDeviceIdentifier, IOptio /** * Describes settings passed to livesync service in order to control event emitting during refresh application. */ -interface IShouldSkipEmitLiveSyncNotification { - /** - * Whether to skip emitting an event during refresh. Default is false. - */ +interface IRefreshApplicationSettings { shouldSkipEmitLiveSyncNotification: boolean; + shouldCheckDeveloperDiscImage: boolean; } /** diff --git a/lib/services/livesync/livesync-service.ts b/lib/services/livesync/livesync-service.ts index aa2acd793d..fd8dc63993 100644 --- a/lib/services/livesync/livesync-service.ts +++ b/lib/services/livesync/livesync-service.ts @@ -164,7 +164,7 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi this.refreshApplicationWithoutDebug(projectData, liveSyncResultInfo, debugOpts, outputPath); } - private async refreshApplicationWithoutDebug(projectData: IProjectData, liveSyncResultInfo: ILiveSyncResultInfo, debugOpts?: IDebugOptions, outputPath?: string, settings?: IShouldSkipEmitLiveSyncNotification): Promise { + private async refreshApplicationWithoutDebug(projectData: IProjectData, liveSyncResultInfo: ILiveSyncResultInfo, debugOpts?: IDebugOptions, outputPath?: string, settings?: IRefreshApplicationSettings): Promise { let result: IRefreshApplicationInfo = { didRestart: false }; const platform = liveSyncResultInfo.deviceAppData.platform; const platformLiveSyncService = this.getLiveSyncService(platform); @@ -184,7 +184,9 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi }); } - this.handleDeveloperDiskImageError(err, liveSyncResultInfo, projectData, debugOpts, outputPath); + if (settings && settings.shouldCheckDeveloperDiscImage) { + this.handleDeveloperDiskImageError(err, liveSyncResultInfo, projectData, debugOpts, outputPath); + } } this.emitLivesyncEvent(LiveSyncEvents.liveSyncExecuted, { @@ -214,7 +216,7 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi this.handleDeveloperDiskImageError(err, liveSyncResultInfo, projectData, debugOptions, outputPath); } } else { - const refreshInfo = await this.refreshApplicationWithoutDebug(projectData, liveSyncResultInfo, debugOptions, outputPath, { shouldSkipEmitLiveSyncNotification: true }); + const refreshInfo = await this.refreshApplicationWithoutDebug(projectData, liveSyncResultInfo, debugOptions, outputPath, { shouldSkipEmitLiveSyncNotification: true, shouldCheckDeveloperDiscImage: true }); didRestart = refreshInfo.didRestart; }