Skip to content

Commit

Permalink
Fix #89735
Browse files Browse the repository at this point in the history
  • Loading branch information
sandy081 committed Jan 30, 2020
1 parent c3dcf4a commit 2e485c0
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/vs/platform/userDataSync/common/settingsSync.ts
Expand Up @@ -294,6 +294,8 @@ export class SettingsSynchroniser extends AbstractFileSynchroniser implements IS
return;
}

let { fileContent, remoteUserData, hasLocalChanged, hasRemoteChanged } = await this.syncPreviewResultPromise;

if (content === undefined) {
if (await this.fileService.exists(this.environmentService.settingsSyncPreviewResource)) {
const settingsPreivew = await this.fileService.readFile(this.environmentService.settingsSyncPreviewResource);
Expand All @@ -309,7 +311,6 @@ export class SettingsSynchroniser extends AbstractFileSynchroniser implements IS
throw error;
}

let { fileContent, remoteUserData, hasLocalChanged, hasRemoteChanged } = await this.syncPreviewResultPromise;
if (!hasLocalChanged && !hasRemoteChanged) {
this.logService.trace('Settings: No changes found during synchronizing settings.');
}
Expand All @@ -324,17 +325,18 @@ export class SettingsSynchroniser extends AbstractFileSynchroniser implements IS
const ref = await this.updateRemoteUserData(remoteContent, forcePush ? null : remoteUserData.ref);
remoteUserData = { ref, content };
}
if (remoteUserData.content) {
this.logService.info('Settings: Updating last synchronised settings');
await this.updateLastSyncUserData(remoteUserData);
}

// Delete the preview
await this.fileService.del(this.environmentService.settingsSyncPreviewResource);
} else {
this.logService.trace('Settings: No changes found during synchronizing settings.');
}

if (remoteUserData.content) {
this.logService.info('Settings: Updating last synchronised settings');
await this.updateLastSyncUserData(remoteUserData);
}

this.syncPreviewResultPromise = null;
}

Expand Down

0 comments on commit 2e485c0

Please sign in to comment.