Skip to content

Commit 703884a

Browse files
Emit liveSyncStarted when the application is really livesynced (#2977)
`liveSyncStarted` event is currently raised before starting initial LiveSync operation. However this makes sense if the name was `liveSyncStarting`. So move the event at the end of the initialSync logic - this way it will be raised for each device when the LiveSync is really started.
1 parent 17e6611 commit 703884a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/services/livesync/livesync-service.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,6 @@ export class LiveSyncService extends EventEmitter implements ILiveSyncService {
213213
// Now fullSync
214214
const deviceAction = async (device: Mobile.IDevice): Promise<void> => {
215215
try {
216-
this.emit(LiveSyncEvents.liveSyncStarted, {
217-
projectDir: projectData.projectDir,
218-
deviceIdentifier: device.deviceInfo.identifier,
219-
applicationIdentifier: projectData.projectId
220-
});
221-
222216
const platform = device.deviceInfo.platform;
223217
const deviceBuildInfoDescriptor = _.find(deviceDescriptors, dd => dd.identifier === device.deviceInfo.identifier);
224218

@@ -240,6 +234,12 @@ export class LiveSyncService extends EventEmitter implements ILiveSyncService {
240234
});
241235
await this.$platformService.trackActionForPlatform({ action: "LiveSync", platform: device.deviceInfo.platform, isForDevice: !device.isEmulator, deviceOsVersion: device.deviceInfo.version });
242236
await this.refreshApplication(projectData, liveSyncResultInfo);
237+
238+
this.emit(LiveSyncEvents.liveSyncStarted, {
239+
projectDir: projectData.projectDir,
240+
deviceIdentifier: device.deviceInfo.identifier,
241+
applicationIdentifier: projectData.projectId
242+
});
243243
} catch (err) {
244244
this.$logger.warn(`Unable to apply changes on device: ${device.deviceInfo.identifier}. Error is: ${err.message}.`);
245245

0 commit comments

Comments
 (0)