fix tests
This commit is contained in:
parent
478a76a1a6
commit
acaf2ed2ac
2 changed files with 9 additions and 11 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue