mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 12:47:13 +01:00
Fix refresh button issue, closes #840
This commit is contained in:
parent
7b7557ec90
commit
504b5f10d9
3 changed files with 6 additions and 7 deletions
|
|
@ -117,8 +117,6 @@ const DaySelector = ({ date, minDate, maxDate, locale, onSelect }) => {
|
|||
const month = date.getMonth();
|
||||
const year = date.getFullYear();
|
||||
|
||||
console.log({ dateLocale, startDay, startWeek, startMonth, month, year });
|
||||
|
||||
const daysOfWeek = [];
|
||||
for (let i = 0; i < 7; i++) {
|
||||
daysOfWeek.push(addDays(startWeek, i));
|
||||
|
|
|
|||
|
|
@ -7,12 +7,9 @@ import Button from './Button';
|
|||
import Refresh from 'assets/redo.svg';
|
||||
import Dots from 'assets/ellipsis-h.svg';
|
||||
import useDateRange from 'hooks/useDateRange';
|
||||
import { getDateRange } from '../../lib/date';
|
||||
import useLocale from 'hooks/useLocale';
|
||||
|
||||
function RefreshButton({ websiteId }) {
|
||||
const dispatch = useDispatch();
|
||||
const { locale } = useLocale();
|
||||
const [dateRange] = useDateRange(websiteId);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const completed = useSelector(state => state.queries[`/api/website/${websiteId}/stats`]);
|
||||
|
|
@ -20,7 +17,7 @@ function RefreshButton({ websiteId }) {
|
|||
function handleClick() {
|
||||
if (dateRange) {
|
||||
setLoading(true);
|
||||
dispatch(setDateRange(websiteId, getDateRange(dateRange.value, locale)));
|
||||
dispatch(setDateRange(websiteId, dateRange));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue