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 { orphanVisitsType, excludeBots = false } = selected;
const propsForOrphanVisitsTypeItem = (type: OrphanVisitType): DropdownItemProps => ({ const propsForOrphanVisitsTypeItem = (type: OrphanVisitType): DropdownItemProps => ({
active: orphanVisitsType === type, active: orphanVisitsType === type,
onClick: () => onChange({ ...selected, orphanVisitsType: type }), onClick: () => onChange({ ...selected, orphanVisitsType: type === selected?.orphanVisitsType ? undefined : type }),
}); });
const onBotsClick = () => onChange({ ...selected, excludeBots: !selected?.excludeBots }); const onBotsClick = () => onChange({ ...selected, excludeBots: !selected?.excludeBots });