fix: check on theme icon variant (#291)

This commit is contained in:
Alessio Occhipinti 2018-11-25 22:12:49 +01:00 committed by Mattia Astorino
parent d83c3f25a1
commit 977be340cb

View file

@ -61,7 +61,10 @@ export function getThemeIconsContribute(ID: string): IPackageJSONThemeIcons {
*/
export function getIconVariantFromTheme(theme: string): string {
const {themeIconVariants} = getDefaultValues();
const found = Object.keys(themeIconVariants).find(variant => theme.includes(variant));
const splitted = theme.split('-');
const variantIcon = splitted[splitted.length - 1];
const found = Object.keys(themeIconVariants)
.find(key => themeIconVariants[key].includes(variantIcon));
return found ? found.toLowerCase() : null;
}