diff --git a/components/common/RefreshButton.js b/components/common/RefreshButton.js index 91a43ab8..343fa174 100644 --- a/components/common/RefreshButton.js +++ b/components/common/RefreshButton.js @@ -16,11 +16,12 @@ function RefreshButton({ websiteId }) { const [dateRange] = useDateRange(websiteId); const [loading, setLoading] = useState(false); const completed = useSelector(state => state.queries[`/api/website/${websiteId}/stats`]); + const createdAt = useSelector(state => state.websites[websiteId]?.createdAt); function handleClick() { if (dateRange) { setLoading(true); - dispatch(setDateRange(websiteId, getDateRange(dateRange.value, locale))); + dispatch(setDateRange(websiteId, getDateRange(dateRange.value, locale, createdAt))); } } diff --git a/components/metrics/WebsiteChart.js b/components/metrics/WebsiteChart.js index dea86ae6..242913a8 100644 --- a/components/metrics/WebsiteChart.js +++ b/components/metrics/WebsiteChart.js @@ -85,6 +85,7 @@ export default function WebsiteChart({ startDate={startDate} endDate={endDate} onChange={setDateRange} + websiteId={websiteId} />