From ece510a53211ccdfacf203ca6d5a21ec88569857 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Fri, 27 Sep 2019 16:51:38 +0200 Subject: [PATCH] fix enablement --- .../userDataSync/common/userDataSyncService.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/vs/platform/userDataSync/common/userDataSyncService.ts b/src/vs/platform/userDataSync/common/userDataSyncService.ts index 55494efb49a..abae73f2bd6 100644 --- a/src/vs/platform/userDataSync/common/userDataSyncService.ts +++ b/src/vs/platform/userDataSync/common/userDataSyncService.ts @@ -131,6 +131,7 @@ export class UserDataAutoSync extends Disposable { @IAuthTokenService private readonly authTokenService: IAuthTokenService, ) { super(); + this.updateEnablement(); this.sync(true); this._register(Event.any(authTokenService.onDidChangeStatus, userDataSyncService.onDidChangeStatus)(() => this.updateEnablement())); this._register(Event.filter(this.configurationService.onDidChangeConfiguration, e => e.affectsConfiguration('configurationSync.enable'))(() => this.updateEnablement())); @@ -155,12 +156,10 @@ export class UserDataAutoSync extends Disposable { private async sync(loop: boolean): Promise { if (this.enabled) { - if (this.authTokenService.status === AuthTokenStatus.Active) { - try { - await this.userDataSyncService.sync(); - } catch (e) { - this.userDataSyncLogService.error(e); - } + try { + await this.userDataSyncService.sync(); + } catch (e) { + this.userDataSyncLogService.error(e); } if (loop) { await timeout(1000 * 5); // Loop sync for every 5s. -- GitLab