Pass required props to refresh button and chart
parent
51bf300eb4
commit
52666b3013
|
@ -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)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -85,6 +85,7 @@ export default function WebsiteChart({
|
|||
startDate={startDate}
|
||||
endDate={endDate}
|
||||
onChange={setDateRange}
|
||||
websiteId={websiteId}
|
||||
/>
|
||||
</div>
|
||||
</StickyHeader>
|
||||
|
|
Loading…
Reference in New Issue