提交 1f419faa 编写于 作者: M Martin Aeschlimann

[theme] remove theme user setting when selecting default

上级 f938ba6e
......@@ -330,7 +330,7 @@ export class ThemeService implements IThemeService {
return this.onFileIconThemeChange.event;
}
private initialize(): TPromise<void> {
private initialize(): TPromise<any> {
let legacyColorThemeId = this.storageService.get('workbench.theme', StorageScope.GLOBAL, null);
let legacyIconThemeId = this.storageService.get('workbench.iconTheme', StorageScope.GLOBAL, null);
......@@ -407,7 +407,11 @@ export class ThemeService implements IThemeService {
private writeColorThemeConfiguration(settingsTarget: ConfigurationTarget) {
if (!types.isUndefinedOrNull(settingsTarget)) {
return this.configurationEditingService.writeConfiguration(settingsTarget, { key: COLOR_THEME_SETTING, value: this.currentColorTheme.settingsId }).then(_ => {
let value = this.currentColorTheme.settingsId;
if (settingsTarget === ConfigurationTarget.USER && this.currentColorTheme.id === DEFAULT_THEME_ID) {
value = void 0; // remove key from user settings
}
return this.configurationEditingService.writeConfiguration(settingsTarget, { key: COLOR_THEME_SETTING, value }).then(_ => {
return this.currentColorTheme;
});
}
......@@ -606,7 +610,11 @@ export class ThemeService implements IThemeService {
private writeFileIconConfiguration(settingsTarget: ConfigurationTarget): TPromise<IFileIconTheme> {
if (!types.isUndefinedOrNull(settingsTarget)) {
return this.configurationEditingService.writeConfiguration(settingsTarget, { key: ICON_THEME_SETTING, value: this.currentIconTheme.settingsId }).then(_ => {
let value = this.currentIconTheme.settingsId;
if (settingsTarget === ConfigurationTarget.USER && this.currentIconTheme.id === '') {
value = void 0; // remove key from user settings
}
return this.configurationEditingService.writeConfiguration(settingsTarget, { key: ICON_THEME_SETTING, value }).then(_ => {
return this.currentIconTheme;
});
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册