Agenda refactor
This commit is contained in:
parent
510fbfc3e0
commit
82ad5f2f76
@ -336,8 +336,11 @@ export default async function CalendarPage() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log(`[AGENDA] Cleanup check: ${syncCountCheck} syncs found for ${allMailCredentialIds.size} mail accounts`);
|
||||||
|
|
||||||
// Only run full cleanup if there are multiple syncs (likely duplicates)
|
// Only run full cleanup if there are multiple syncs (likely duplicates)
|
||||||
if (syncCountCheck > allMailCredentialIds.size) {
|
if (syncCountCheck > allMailCredentialIds.size) {
|
||||||
|
console.log(`[AGENDA] Running cleanup: ${syncCountCheck} syncs > ${allMailCredentialIds.size} accounts (potential duplicates)`);
|
||||||
const allSyncs = await prisma.calendarSync.findMany({
|
const allSyncs = await prisma.calendarSync.findMany({
|
||||||
where: {
|
where: {
|
||||||
calendar: {
|
calendar: {
|
||||||
@ -580,6 +583,7 @@ export default async function CalendarPage() {
|
|||||||
|
|
||||||
// Exclude "Privée"/"Default" calendars that are not actively synced
|
// Exclude "Privée"/"Default" calendars that are not actively synced
|
||||||
if (isPrivateOrDefault && !hasActiveSync) {
|
if (isPrivateOrDefault && !hasActiveSync) {
|
||||||
|
console.log(`[AGENDA] Filtering out calendar ${cal.name} (${cal.id}): syncEnabled=${cal.syncConfig?.syncEnabled}, hasMailCredential=${!!cal.syncConfig?.mailCredential}`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user