mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-06 11:15:21 +03:00
Refactor Calendar component to update month details only when year or month changes
This commit is contained in:
parent
98576418a8
commit
0a1024983d
@ -101,10 +101,9 @@ const Calendar = ({ onChange, calendarRef, close, dateRange, children }) => {
|
|||||||
setState((prev) => ({
|
setState((prev) => ({
|
||||||
...prev,
|
...prev,
|
||||||
selectedDay: todayTimestamp,
|
selectedDay: todayTimestamp,
|
||||||
monthDetails: getMonthDetails(year, month),
|
monthDetails: getMonthDetails(year, month)
|
||||||
timeRange: { ...dateRange },
|
|
||||||
}));
|
}));
|
||||||
}, [year, month, getMonthDetails, dateRange]);
|
}, [year, month, getMonthDetails]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// add refs for keyboard navigation
|
// add refs for keyboard navigation
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user