Allowed to deselect orphan visits type

This commit is contained in:
Alejandro Celaya 2021-07-02 20:05:51 +02:00
parent 635ee6c5eb
commit 7c11a6d1ab

View file

@ -21,7 +21,7 @@ export const VisitsFilterDropdown = (
const { orphanVisitsType, excludeBots = false } = selected;
const propsForOrphanVisitsTypeItem = (type: OrphanVisitType): DropdownItemProps => ({
active: orphanVisitsType === type,
onClick: () => onChange({ ...selected, orphanVisitsType: type }),
onClick: () => onChange({ ...selected, orphanVisitsType: type === selected?.orphanVisitsType ? undefined : type }),
});
const onBotsClick = () => onChange({ ...selected, excludeBots: !selected?.excludeBots });