From 702c73dafd40d6d867e334445c8db0fbe79a0df4 Mon Sep 17 00:00:00 2001 From: Manuel Kostka <26887899+nolosb@users.noreply.github.com> Date: Mon, 17 Jun 2024 02:09:42 +0100 Subject: [PATCH] FIX: Render legacy color declaration (#34) --- javascripts/discourse/initializers/category-icons.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/javascripts/discourse/initializers/category-icons.js b/javascripts/discourse/initializers/category-icons.js index c80baf2..85128c4 100644 --- a/javascripts/discourse/initializers/category-icons.js +++ b/javascripts/discourse/initializers/category-icons.js @@ -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);