Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

bug fix. remove All time filter for websites with no data.

Francis Cao2df24a78ca16
diff --git a/src/components/input/WebsiteDateFilter.tsx b/src/components/input/WebsiteDateFilter.tsx
index a76058eca..58e596f52 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({
<DateFilter
value={dateValue}
onChange={handleChange}
- showAllTime={showAllTime}
+ showAllTime={hasData && showAllTime}
renderDate={+offset !== 0}
/>
</Row>