diff --git a/components/calendar/calendar-client.tsx b/components/calendar/calendar-client.tsx index 41dcffb..d313320 100644 --- a/components/calendar/calendar-client.tsx +++ b/components/calendar/calendar-client.tsx @@ -1149,21 +1149,11 @@ export function CalendarClient({ initialCalendars, userId, userProfile }: Calend }; const getCalendarDisplayName = (calendar: CalendarWithMission) => { - // If calendar is synced to an external account, show provider name + account name + // If calendar is synced to an external account, use the same display name as in courrier if (calendar.syncConfig?.syncEnabled && calendar.syncConfig?.mailCredential) { - const provider = calendar.syncConfig.provider; - const accountName = calendar.syncConfig.mailCredential.display_name || - calendar.syncConfig.mailCredential.email; - - // Add provider prefix to distinguish Infomaniak from Microsoft - if (provider === 'infomaniak') { - return `Infomaniak (${accountName})`; - } else if (provider === 'microsoft') { - return `Microsoft (${accountName})`; - } else { - // Fallback for unknown providers - return accountName; - } + // Use display_name if available, otherwise use email (same logic as courrier page) + return calendar.syncConfig.mailCredential.display_name || + calendar.syncConfig.mailCredential.email; } // For non-synced calendars, use the calendar name