fix(folder-accent): removed useless method and fix accent custom conf (#169)

This commit is contained in:
Alessio Occhipinti 2018-04-23 22:51:15 +02:00 committed by Mattia Astorino
parent a75e66acb7
commit 6992a38e1c

View file

@ -81,40 +81,13 @@ export function setCustomSettings(settingsObject: IThemeCustomProperties): Thena
return vscode.workspace.getConfiguration().update('materialTheme.cache.workbench.settings', settings, true);
}
/**
* Determines if the window should reload
* @export
* @param {string} themeColour
* @param {string} themeIcons
* @returns {boolean}
*/
export function shouldReloadWindow(themeColour: string, themeIcons: string): boolean {
let isTheme: boolean = isMaterialTheme(themeColour);
let isThemeIcons: boolean = isMaterialThemeIcons(themeIcons);
if (!isTheme && !isThemeIcons) return false;
let customSettings = getCustomSettings();
return customSettings.accent !== customSettings.accentPrevious;
}
/**
* Updates accent name
* @export
* @param {string} accentName
*/
export function updateAccent(accentName: string): Thenable<void> {
let config: IThemeCustomProperties = getCustomSettings();
let prevaccent = getAccent();
if (prevaccent !== undefined && prevaccent !== accentName) {
config.accentPrevious = prevaccent;
} else if (accentName === undefined) {
config.accentPrevious = undefined;
}
config.accent = accentName;
return setCustomSettings(config);
const prevaccent = getAccent();
return setCustomSetting('accentPrevious', prevaccent)
.then(() => setCustomSetting('accent', accentName));
}