Skip to content

Commit e91c4a1

Browse files
committed
remember last sync store url
1 parent 0736d1b commit e91c4a1

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/vs/platform/userDataSync/common/userDataAutoSyncService.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ type AutoSyncErrorClassification = {
3232
const enablementKey = 'sync.enable';
3333
const disableMachineEventuallyKey = 'sync.disableMachineEventually';
3434
const sessionIdKey = 'sync.sessionId';
35+
const storeUrlKey = 'sync.storeUrl';
3536

3637
export class UserDataAutoSyncEnablementService extends Disposable {
3738

@@ -97,15 +98,20 @@ export class UserDataAutoSyncService extends UserDataAutoSyncEnablementService i
9798
this.syncTriggerDelayer = this._register(new Delayer<void>(0));
9899

99100
if (userDataSyncStoreService.userDataSyncStore) {
101+
102+
storageService.store(storeUrlKey, userDataSyncStoreService.userDataSyncStore.url.toString(), StorageScope.GLOBAL);
103+
100104
if (this.isEnabled()) {
101105
this.logService.info('Auto Sync is enabled.');
102106
} else {
103107
this.logService.info('Auto Sync is disabled.');
104108
}
105109
this.updateAutoSync();
110+
106111
if (this.hasToDisableMachineEventually()) {
107112
this.disableMachineEventually();
108113
}
114+
109115
this._register(userDataSyncAccountService.onDidChangeAccount(() => this.updateAutoSync()));
110116
this._register(userDataSyncStoreService.onDidChangeDonotMakeRequestsUntil(() => this.updateAutoSync()));
111117
this._register(Event.debounce<string, string[]>(userDataSyncService.onDidChangeLocal, (last, source) => last ? [...last, source] : [source], 1000)(sources => this.triggerSync(sources, false)));

0 commit comments

Comments
 (0)