fix(TALE-4): prevent duplicate ACL tags from being added

This commit is contained in:
Aarnav Tale 2024-07-07 14:57:16 -04:00
parent 1db385e716
commit c60652e39f
No known key found for this signature in database

View File

@ -124,7 +124,11 @@ export default function Tags({ machine, state }: TagsProps) {
!tag.startsWith('tag:')
&& 'opacity-50 cursor-not-allowed',
)}
isDisabled={!tag.startsWith('tag:')}
isDisabled={
tag.length === 0
|| !tag.startsWith('tag:')
|| tags.includes(tag)
}
onPress={() => {
setTags([...tags, tag])
setTag('')