FIX: Render legacy color declaration (#34)

This commit is contained in:
Manuel Kostka 2024-06-17 02:09:42 +01:00 committed by GitHub
parent fb4fbf3e79
commit 702c73dafd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 3 deletions

View File

@ -186,11 +186,12 @@ export default {
categoryId: category.id, categoryId: category.id,
prefixType: "icon", prefixType: "icon",
prefixValue: icon, prefixValue: icon,
prefixColor: color ? color : category.color, prefixColor: color,
}; };
if (color && !color.match(/categoryColo(u*)r/g)) { // Fix for legacy color declaration
opts.prefixColor = color.replace(/^#/, ""); if (color?.match(/categoryColo(u*)r/g)) {
opts.prefixColor = category.color;
} }
api.registerCustomCategorySectionLinkPrefix(opts); api.registerCustomCategorySectionLinkPrefix(opts);