FIX: match exact slugs only

This commit is contained in:
Penar Musaraj 2019-01-17 10:59:00 -05:00
parent e970dea5c8
commit 85279dc139
1 changed files with 6 additions and 4 deletions

View File

@ -67,10 +67,12 @@ function categoryIconsRenderer(category, opts) {
let categoryThemeItem = categoryThemeList.find((str) => str.indexOf(category.slug) > -1);
if (categoryThemeItem) {
let iconItem = categoryThemeItem.split(',');
let itemColor = iconItem[2] ? `style="color: ${iconItem[2]}"` : "";
let itemIcon = iconItem[1] != '' ? iconHTML(iconItem[1]) : "";
html += `<span ${itemColor} class="category-badge-icon">${itemIcon}</span>`;
// Ensure exact match
if(iconItem[0] == category.slug) {
let itemColor = iconItem[2] ? `style="color: ${iconItem[2]}"` : "";
let itemIcon = iconItem[1] != '' ? iconHTML(iconItem[1]) : "";
html += `<span ${itemColor} class="category-badge-icon">${itemIcon}</span>`;
}
}
/// End custom category icon