Fix tag filter bug

Signed-off-by: Sarah Medeiros <smedeiros@wayfair.com>
This commit is contained in:
Sarah Medeiros
2022-12-15 15:57:57 -05:00
parent 37426f6f5e
commit 228f4db4fa
@@ -94,9 +94,12 @@ export const EntityTagPicker = (props: EntityTagPickerProps) => {
useEffect(() => {
updateFilters({
tags: selectedTags.length ? new EntityTagFilter(selectedTags) : undefined,
tags:
selectedTags.length && Object.keys(availableTags ?? {}).length
? new EntityTagFilter(selectedTags)
: undefined,
});
}, [selectedTags, updateFilters]);
}, [selectedTags, updateFilters, availableTags]);
if (!Object.keys(availableTags ?? {}).length) return null;