diff --git a/src/components/tags/Tags/index.tsx b/src/components/tags/Tags/index.tsx index 6b06db52..0f4acf4b 100644 --- a/src/components/tags/Tags/index.tsx +++ b/src/components/tags/Tags/index.tsx @@ -35,7 +35,13 @@ export const Tags: FC = ({ } const exist = tags.map(tag => tag.title); - onTagsChange(uniq([...exist, ...data, ...last]).filter(el => el) as string[]); + const uniqueTags = uniq([...exist, ...data, ...last]).filter(el => el) as string[]; + + if (uniqueTags.length === exist.length) { + return; + } + + onTagsChange(uniqueTags); }, [data] ); diff --git a/src/redux/node/sagas.ts b/src/redux/node/sagas.ts index 22510d40..8243d16d 100644 --- a/src/redux/node/sagas.ts +++ b/src/redux/node/sagas.ts @@ -252,6 +252,7 @@ function* onDeleteTag({ id, tagId }: ReturnType) { try { const { tags }: Unwrap = yield call(apiDeleteNodeTag, { id, tagId }); yield put(nodeSetTags(tags)); + yield call(nodeGetRelated, id); } catch {} }