Skip to content

TagSpaces is an offline, open source, document manager with tagging support

chore: changing the tag color priority to the tag library

Ilian Sapundshiev16a98adb316a
diff --git a/src/renderer/components/TagContainer.tsx b/src/renderer/components/TagContainer.tsx
index d0624fc09..e33c1c647 100644
--- a/src/renderer/components/TagContainer.tsx
+++ b/src/renderer/components/TagContainer.tsx
@@ -84,18 +84,14 @@ function TagContainer(props: Props) {
() => !isTagGeo && !tagGroup && isDateTimeTag(title),
[isTagGeo, title, tagGroup],
);
- if (tag.color && tag.textcolor) {
- textColor = tag.textcolor;
- backgroundColor = tag.color;
- } else {
- const tagColors = getTagColors(
- title,
- defaultTextColor,
- defaultBackgroundColor,
- );
- textColor = tagColors.textcolor;
- backgroundColor = tagColors.color;
- }
+
+ const tagColors = getTagColors(
+ title,
+ tag.textcolor || defaultTextColor,
+ tag.color || defaultBackgroundColor,
+ );
+ textColor = tagColors.textcolor;
+ backgroundColor = tagColors.color;
let tid = 'tagContainer_';
if (title && title.length > 0) {