refactor: stabilize calendar loading effects and menubar redirect

- Memoize calendar range strings and stabilize effect deps
- Guard updateDarkColor to avoid dispatch loops
- Add resilient cache-clear handling with refs
- Memoize calendar/temp ids to prevent rerenders
- Update event handler hooks with missing deps
- Add guards and dependency fixes across Calendar effects
This commit is contained in:
lenhanphung
2025-11-07 16:42:06 +07:00
committed by Benoit TELLIER
parent 990e290066
commit ffe204d60b
13 changed files with 650 additions and 163 deletions
+2 -2
View File
@@ -59,10 +59,10 @@ function EventPopover({
const selectPersonalCalendars = createSelector(
(state: any) => state.calendars,
(calendars: any) =>
Object.keys(calendars.list)
Object.keys(calendars.list || {})
.map((id) => {
if (id.split("/")[0] === userId) {
return calendars.list[id];
return calendars.list?.[id];
}
return {} as Calendars;
})
+2 -2
View File
@@ -17,8 +17,8 @@ export default function ImportAlert() {
return (
<>
{Object.keys(calendars).map((calendarId) =>
calendars[calendarId]?.events
{Object.keys(calendars || {}).map((calendarId) =>
calendars?.[calendarId]?.events
? Object.keys(calendars[calendarId]?.events)
.filter((id) => calendars[calendarId]?.events[id].error)
.map((id) => {