fix tests

This commit is contained in:
Sandeep Somavarapu committed 2021-02-09 17:25:55 +01:00
1 parent 478a76a1a6
commit acaf2ed2ac
2 files changed
+9 -11

No files matched your search

@@ -73,10 +73,9 @@ export class UserDataAutoSyncEnablementService extends Disposable implements _IU
}
setEnablement(enabled: boolean): void {
if (!this.canToggleEnablement()) {
throw new Error('Cannot toggle enablement');
if (this.canToggleEnablement()) {
this.storageService.store(enablementKey, enabled, StorageScope.GLOBAL, StorageTarget.MACHINE);
}
this.storageService.store(enablementKey, enabled, StorageScope.GLOBAL, StorageTarget.MACHINE);
}
private onDidStorageChange(storageChangeEvent: IStorageValueChangeEvent): void {
@@ -29,14 +29,13 @@ export class WebUserDataAutoSyncEnablementService extends UserDataAutoSyncEnable
}
setEnablement(enabled: boolean) {
if (!this.canToggleEnablement()) {
throw new Error('Cannot toggle enablement');
}
if (this.enabled !== enabled) {
this.enabled = enabled;
super.setEnablement(enabled);
if (this.workbenchEnvironmentService.options?.settingsSyncOptions?.enablementHandler) {
this.workbenchEnvironmentService.options.settingsSyncOptions.enablementHandler(this.enabled);
if (this.canToggleEnablement()) {
if (this.enabled !== enabled) {
this.enabled = enabled;
super.setEnablement(enabled);
if (this.workbenchEnvironmentService.options?.settingsSyncOptions?.enablementHandler) {
this.workbenchEnvironmentService.options.settingsSyncOptions.enablementHandler(this.enabled);
}
}
}
}