Ux/reload notification (#232)
* chore: check on installation type now as single module * feat(Reload notification): added support for after-install notification * feat(Reload notification): added support never show again notification
This commit is contained in:
parent
c91cc8cc0f
commit
48c6feaf75
10 changed files with 158 additions and 73 deletions
|
@ -1,13 +1,10 @@
|
|||
import {
|
||||
ConfigurationChangeEvent
|
||||
} from 'vscode';
|
||||
import {getCustomSettings, isMaterialThemeIcons, isAutoApplyEnable, isMaterialTheme} from './settings';
|
||||
import {getCustomSettings, isMaterialThemeIcons, isMaterialTheme} from './settings';
|
||||
import {getCurrentThemeIconsID, getCurrentThemeID} from './vscode';
|
||||
|
||||
import * as ThemeCommands from './../commands';
|
||||
import {infoMessage} from './messages';
|
||||
|
||||
const icons = () => isAutoApplyEnable() ? ThemeCommands.fixIcons() : infoMessage();
|
||||
import handleAutoapply from './handle-autoapply';
|
||||
|
||||
const onIconsChanged = () => {
|
||||
const customSettings = getCustomSettings();
|
||||
|
@ -16,27 +13,18 @@ const onIconsChanged = () => {
|
|||
}
|
||||
|
||||
const currentIconsTheme = getCurrentThemeIconsID();
|
||||
if (isMaterialThemeIcons(currentIconsTheme)) {
|
||||
return icons();
|
||||
}
|
||||
return handleAutoapply(isMaterialThemeIcons(currentIconsTheme));
|
||||
};
|
||||
|
||||
const onThemeChanged = () => {
|
||||
const currentTheme = getCurrentThemeID();
|
||||
if (isMaterialTheme(currentTheme)) {
|
||||
return icons();
|
||||
}
|
||||
return handleAutoapply(isMaterialTheme(currentTheme));
|
||||
};
|
||||
|
||||
export const onChangeConfiguration = (event: ConfigurationChangeEvent) => {
|
||||
const isColorTheme = event.affectsConfiguration('workbench.colorTheme');
|
||||
const isIconTheme = event.affectsConfiguration('workbench.iconTheme');
|
||||
|
||||
if (isIconTheme) {
|
||||
return onIconsChanged();
|
||||
}
|
||||
|
||||
if (isColorTheme) {
|
||||
return onThemeChanged();
|
||||
}
|
||||
return isIconTheme ? onIconsChanged() :
|
||||
isColorTheme ? onThemeChanged() : null;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue