fixed bug where trying adding two identical tags just added none

This commit is contained in:
reece 2019-10-23 13:00:01 +01:00 committed by Sean Yesmunt
parent 4cea57060e
commit 0caac8e402

View file

@ -62,7 +62,8 @@ export default function TagsSearch(props: Props) {
setNewTag('');
tags = tags.split(',').map(newTag => newTag.trim().toLowerCase());
// Split into individual tags, normalize the tags, and remove duplicates with sets.
tags = [...new Set(tags.split(',').map(newTag => newTag.trim().toLowerCase()))];
tags.forEach(tag => {
if (onSelect) {
onSelect({ name: tag });