diff --git a/src/components/input/WebsiteDateFilter.tsx b/src/components/input/WebsiteDateFilter.tsx index a76058ec..58e596f5 100644 --- a/src/components/input/WebsiteDateFilter.tsx +++ b/src/components/input/WebsiteDateFilter.tsx @@ -31,9 +31,11 @@ export function WebsiteDateFilter({ const showCompare = allowCompare && !isAllTime; const websiteDateRange = useDateRangeQuery(websiteId); + const { startDate, endDate } = websiteDateRange; + const hasData = startDate && endDate; const handleChange = (date: string) => { - if (date === 'all') { + if (date === 'all' && hasData) { router.push( updateParams({ date: `${getDateRangeValue(websiteDateRange.startDate, websiteDateRange.endDate)}:all`, @@ -78,7 +80,7 @@ export function WebsiteDateFilter({