feat: already existing tags can't be added again

This commit is contained in:
overflowerror 2021-10-10 17:14:41 +02:00
parent 984da2c2bc
commit d50c062d80

View file

@ -58,10 +58,13 @@ const MediaDetails: FunctionComponent<MediaDetailsProps> = ({basePath, file, onU
setNewTagInput(value)
}}
/>
<button onClick={() => {
addTag(newTagInput)
setNewTagInput("")
}}>
<button
onClick={() => {
addTag(newTagInput)
setNewTagInput("")
}}
disabled={currentFile.getTags().indexOf(newTagInput) >= 0}
>
Add
</button>
</li>