Pass required props to refresh button and chart
parent
51bf300eb4
commit
52666b3013
|
@ -16,11 +16,12 @@ function RefreshButton({ websiteId }) {
|
||||||
const [dateRange] = useDateRange(websiteId);
|
const [dateRange] = useDateRange(websiteId);
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const completed = useSelector(state => state.queries[`/api/website/${websiteId}/stats`]);
|
const completed = useSelector(state => state.queries[`/api/website/${websiteId}/stats`]);
|
||||||
|
const createdAt = useSelector(state => state.websites[websiteId]?.createdAt);
|
||||||
|
|
||||||
function handleClick() {
|
function handleClick() {
|
||||||
if (dateRange) {
|
if (dateRange) {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
dispatch(setDateRange(websiteId, getDateRange(dateRange.value, locale)));
|
dispatch(setDateRange(websiteId, getDateRange(dateRange.value, locale, createdAt)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -85,6 +85,7 @@ export default function WebsiteChart({
|
||||||
startDate={startDate}
|
startDate={startDate}
|
||||||
endDate={endDate}
|
endDate={endDate}
|
||||||
onChange={setDateRange}
|
onChange={setDateRange}
|
||||||
|
websiteId={websiteId}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</StickyHeader>
|
</StickyHeader>
|
||||||
|
|
Loading…
Reference in New Issue