Agenda Sync refactor
This commit is contained in:
parent
bf36a05eb6
commit
51e37af4c8
@ -58,8 +58,7 @@ export default async function CalendarPage() {
|
|||||||
{ name: { in: ["Privée", "Default"] } },
|
{ name: { in: ["Privée", "Default"] } },
|
||||||
{
|
{
|
||||||
syncConfig: {
|
syncConfig: {
|
||||||
isNot: null,
|
isNot: null
|
||||||
syncEnabled: true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@ -199,8 +198,7 @@ export default async function CalendarPage() {
|
|||||||
{ name: { in: ["Privée", "Default"] } },
|
{ name: { in: ["Privée", "Default"] } },
|
||||||
{
|
{
|
||||||
syncConfig: {
|
syncConfig: {
|
||||||
isNot: null,
|
isNot: null
|
||||||
syncEnabled: true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@ -233,6 +231,18 @@ export default async function CalendarPage() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// No default calendar creation - only synced calendars from courrier
|
// No default calendar creation - only synced calendars from courrier
|
||||||
|
|
||||||
|
// Filter out "Privée" and "Default" calendars that don't have active sync
|
||||||
|
calendars = calendars.filter(cal => {
|
||||||
|
const isPrivateOrDefault = cal.name === "Privée" || cal.name === "Default";
|
||||||
|
const hasActiveSync = cal.syncConfig?.syncEnabled === true && cal.syncConfig?.mailCredential;
|
||||||
|
|
||||||
|
// Exclude "Privée"/"Default" calendars that are not actively synced
|
||||||
|
if (isPrivateOrDefault && !hasActiveSync) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const nextWeek = add(now, { days: 7 });
|
const nextWeek = add(now, { days: 7 });
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user