Agenda refactor
This commit is contained in:
parent
56458691cc
commit
16e22b50a9
@ -1149,21 +1149,11 @@ export function CalendarClient({ initialCalendars, userId, userProfile }: Calend
|
|||||||
};
|
};
|
||||||
|
|
||||||
const getCalendarDisplayName = (calendar: CalendarWithMission) => {
|
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) {
|
if (calendar.syncConfig?.syncEnabled && calendar.syncConfig?.mailCredential) {
|
||||||
const provider = calendar.syncConfig.provider;
|
// Use display_name if available, otherwise use email (same logic as courrier page)
|
||||||
const accountName = calendar.syncConfig.mailCredential.display_name ||
|
return calendar.syncConfig.mailCredential.display_name ||
|
||||||
calendar.syncConfig.mailCredential.email;
|
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// For non-synced calendars, use the calendar name
|
// For non-synced calendars, use the calendar name
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user