fix switching to insiders when settings sync is disabled

This commit is contained in:
Sandeep Somavarapu 2021-07-27 21:47:03 +02:00
parent d9cc12292d
commit c35100aba3
No known key found for this signature in database
GPG key ID: 1FED25EC4646638B

View file

@ -529,7 +529,9 @@ export class SwitchProductQualityContribution extends Disposable implements IWor
const storageService = accessor.get(IStorageService);
const userDataSyncWorkbenchService = accessor.get(IUserDataSyncWorkbenchService);
const userDataSyncService = accessor.get(IUserDataSyncService);
const notificationService = accessor.get(INotificationService);
try {
const selectSettingsSyncServiceDialogShownKey = 'switchQuality.selectSettingsSyncServiceDialogShown';
const userDataSyncStore = userDataSyncStoreManagementService.userDataSyncStore;
let userDataSyncStoreType: UserDataSyncStoreType | undefined;
@ -563,8 +565,8 @@ export class SwitchProductQualityContribution extends Disposable implements IWor
promises.push(Event.toPromise(Event.filter(userDataSyncService.onDidChangeStatus, status => status !== SyncStatus.Syncing)));
}
// Synchronise the store type option in insiders service, so that other clients using insiders service are also updated.
if (isSwitchingToInsiders) {
// If user chose the sync service then synchronise the store type option in insiders service, so that other clients using insiders service are also updated.
if (isSwitchingToInsiders && userDataSyncStoreType) {
promises.push(userDataSyncWorkbenchService.synchroniseUserDataSyncStoreType());
}
@ -577,6 +579,9 @@ export class SwitchProductQualityContribution extends Disposable implements IWor
storageService.remove(selectSettingsSyncServiceDialogShownKey, StorageScope.GLOBAL);
}
}
} catch (error) {
notificationService.error(error);
}
}
private async selectSettingsSyncService(dialogService: IDialogService): Promise<UserDataSyncStoreType | undefined> {