From 7c11a6d1ab61d61b8539c6f729e2d76a8aac943b Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Fri, 2 Jul 2021 20:05:51 +0200 Subject: [PATCH] Allowed to deselect orphan visits type --- src/visits/helpers/VisitsFilterDropdown.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/visits/helpers/VisitsFilterDropdown.tsx b/src/visits/helpers/VisitsFilterDropdown.tsx index 3c98bd0e..27936a90 100644 --- a/src/visits/helpers/VisitsFilterDropdown.tsx +++ b/src/visits/helpers/VisitsFilterDropdown.tsx @@ -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 });