From ae625e4c8af6827577d14eb9e12179556b86e959 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Tue, 6 Dec 2022 20:13:43 +0100 Subject: [PATCH] Fixed all visits interval not working after loading the default configured interval unless switching to another one first --- src/visits/helpers/hooks.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/visits/helpers/hooks.ts b/src/visits/helpers/hooks.ts index af19d9c8..2c78b65f 100644 --- a/src/visits/helpers/hooks.ts +++ b/src/visits/helpers/hooks.ts @@ -37,7 +37,7 @@ export const useVisitsQuery = (): [VisitsFiltering, UpdateFiltering] => { ({ startDate, endDate, orphanVisitsType, excludeBots, domain }: VisitsQuery): VisitsFilteringAndDomain => ({ domain, filtering: { - dateRange: startDate || endDate ? datesToDateRange(startDate, endDate) : undefined, + dateRange: startDate != null || endDate != null ? datesToDateRange(startDate, endDate) : undefined, visitsFilter: { orphanVisitsType, excludeBots: excludeBots === 'true' }, }, }), @@ -47,8 +47,8 @@ export const useVisitsQuery = (): [VisitsFiltering, UpdateFiltering] => { const updateFiltering = (extra: DeepPartial) => { const { dateRange, visitsFilter } = mergeDeepRight(filtering, extra); const query: VisitsQuery = { - startDate: (dateRange?.startDate && formatIsoDate(dateRange.startDate)) || undefined, - endDate: (dateRange?.endDate && formatIsoDate(dateRange.endDate)) || undefined, + startDate: (dateRange?.startDate && formatIsoDate(dateRange.startDate)) || '', + endDate: (dateRange?.endDate && formatIsoDate(dateRange.endDate)) || '', excludeBots: visitsFilter.excludeBots ? 'true' : undefined, orphanVisitsType: visitsFilter.orphanVisitsType, domain: theDomain,