Skip to content

Commit

Permalink
FIX: Render legacy color declaration (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
nolosb authored Jun 17, 2024
1 parent fb4fbf3 commit 702c73d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions javascripts/discourse/initializers/category-icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,12 @@ export default {
categoryId: category.id,
prefixType: "icon",
prefixValue: icon,
prefixColor: color ? color : category.color,
prefixColor: color,
};

if (color && !color.match(/categoryColo(u*)r/g)) {
opts.prefixColor = color.replace(/^#/, "");
// Fix for legacy color declaration
if (color?.match(/categoryColo(u*)r/g)) {
opts.prefixColor = category.color;
}

api.registerCustomCategorySectionLinkPrefix(opts);
Expand Down

0 comments on commit 702c73d

Please sign in to comment.