651 calendar auto hide upon loads (#667)

* [#651] fix duplicated initialisatoin at login
* [#651] prevent event overwrite when getting calendars list

Co-authored-by: Camille Moussu <cmoussu@linagora.com>
This commit is contained in:
Camille Moussu
2026-03-18 18:13:04 +01:00
committed by GitHub
parent a17320b861
commit a8bff830ad
5 changed files with 112 additions and 61 deletions
+16 -1
View File
@@ -126,10 +126,25 @@ const CalendarSlice = createSlice({
}>
) => {
state.pending = false;
state.list = action.payload.importedCalendars;
state.error = action.payload.errors.length
? action.payload.errors
: null;
Object.entries(action.payload.importedCalendars).forEach(
([id, cal]) => {
state.list[id] = {
...cal,
events: state.list[id]?.events || {},
};
}
);
// Remove calendars that no longer exist
Object.keys(state.list).forEach((id) => {
if (!action.payload.importedCalendars[id]) {
delete state.list[id];
}
});
}
)
.addCase(