TagSpaces is an offline, open source, document manager with tagging support
fix: showing no duplicated tags in the tagging dialog #1188
Ilian Sapundshiev46ba3e37fc19
diff --git a/app/reducers/taglibrary.ts b/app/reducers/taglibrary.tsindex e4a85b591..d45fd314f 100644--- a/app/reducers/taglibrary.ts+++ b/app/reducers/taglibrary.ts@@ -551,13 +551,16 @@ export const actions = {// Selectorsexport const getTagGroups = (state: any) => state.taglibrary;export const getAllTags = (state: any) => {- const allTags: Array<Tag> = [];+ const uniqueTags: Array<Tag> = [];state.taglibrary.forEach(tagGroup => {tagGroup.children.forEach(tag => {- allTags.push(tag);+ const found = uniqueTags.find(uTag => uTag.title === tag.title);+ if (!found) {+ uniqueTags.push(tag);+ }});});- return allTags.sort((a, b) =>+ return uniqueTags.sort((a, b) =>a.title > b.title ? 1 : a.title < b.title ? -1 : 0);};