Adopt onSpecificOptionChange

This commit is contained in:
Daniel Imms
2022-10-09 07:46:10 -07:00
parent cad9c4164c
commit 415100e8b8
8 changed files with 18 additions and 53 deletions
+2 -10
View File
@@ -111,16 +111,8 @@ export class ThemeService extends Disposable implements IThemeService {
this._updateRestoreColors();
this._setTheme(this._optionsService.rawOptions.theme);
this.register(this._optionsService.onOptionChange(key => {
switch (key) {
case 'minimumContrastRatio':
this._contrastCache.clear();
break;
case 'theme':
this._setTheme(this._optionsService.rawOptions.theme);
break;
}
}));
this.register(this._optionsService.onSpecificOptionChange('minimumContrastRatio', () => this._contrastCache.clear()));
this.register(this._optionsService.onSpecificOptionChange('theme', () => this._setTheme(this._optionsService.rawOptions.theme)));
}
/**