mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
skipping tag update on empty tags
This commit is contained in:
parent
04a7b28a53
commit
f12f952b37
2 changed files with 8 additions and 1 deletions
|
@ -35,7 +35,13 @@ export const Tags: FC<IProps> = ({
|
|||
}
|
||||
|
||||
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]
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue