Skip to content

Commit 59ccd8f

Browse files
committed
fix: require user interaction for developer disk image only in debug
1 parent 7b4d2b7 commit 59ccd8f

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

lib/definitions/livesync.d.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -330,11 +330,9 @@ interface IEnableDebuggingDeviceOptions extends Mobile.IDeviceIdentifier, IOptio
330330
/**
331331
* Describes settings passed to livesync service in order to control event emitting during refresh application.
332332
*/
333-
interface IShouldSkipEmitLiveSyncNotification {
334-
/**
335-
* Whether to skip emitting an event during refresh. Default is false.
336-
*/
333+
interface IRefreshApplicationSettings {
337334
shouldSkipEmitLiveSyncNotification: boolean;
335+
shouldCheckDeveloperDiscImage: boolean;
338336
}
339337

340338
/**

lib/services/livesync/livesync-service.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
164164
this.refreshApplicationWithoutDebug(projectData, liveSyncResultInfo, debugOpts, outputPath);
165165
}
166166

167-
private async refreshApplicationWithoutDebug(projectData: IProjectData, liveSyncResultInfo: ILiveSyncResultInfo, debugOpts?: IDebugOptions, outputPath?: string, settings?: IShouldSkipEmitLiveSyncNotification): Promise<IRefreshApplicationInfo> {
167+
private async refreshApplicationWithoutDebug(projectData: IProjectData, liveSyncResultInfo: ILiveSyncResultInfo, debugOpts?: IDebugOptions, outputPath?: string, settings?: IRefreshApplicationSettings): Promise<IRefreshApplicationInfo> {
168168
let result: IRefreshApplicationInfo = { didRestart: false };
169169
const platform = liveSyncResultInfo.deviceAppData.platform;
170170
const platformLiveSyncService = this.getLiveSyncService(platform);
@@ -184,7 +184,9 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
184184
});
185185
}
186186

187-
this.handleDeveloperDiskImageError(err, liveSyncResultInfo, projectData, debugOpts, outputPath);
187+
if (settings && settings.shouldCheckDeveloperDiscImage) {
188+
this.handleDeveloperDiskImageError(err, liveSyncResultInfo, projectData, debugOpts, outputPath);
189+
}
188190
}
189191

190192
this.emitLivesyncEvent(LiveSyncEvents.liveSyncExecuted, {
@@ -214,7 +216,7 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
214216
this.handleDeveloperDiskImageError(err, liveSyncResultInfo, projectData, debugOptions, outputPath);
215217
}
216218
} else {
217-
const refreshInfo = await this.refreshApplicationWithoutDebug(projectData, liveSyncResultInfo, debugOptions, outputPath, { shouldSkipEmitLiveSyncNotification: true });
219+
const refreshInfo = await this.refreshApplicationWithoutDebug(projectData, liveSyncResultInfo, debugOptions, outputPath, { shouldSkipEmitLiveSyncNotification: true, shouldCheckDeveloperDiscImage: true });
218220
didRestart = refreshInfo.didRestart;
219221
}
220222

0 commit comments

Comments
 (0)