diff --git a/frontend/app/components/workspace/CrmWorkspaceApp.vue b/frontend/app/components/workspace/CrmWorkspaceApp.vue index 2a8d88f..6076830 100644 --- a/frontend/app/components/workspace/CrmWorkspaceApp.vue +++ b/frontend/app/components/workspace/CrmWorkspaceApp.vue @@ -960,6 +960,32 @@ function threadChannelLabel(thread: { id: string; channels: CommItem["channel"][ return "No channel"; } +const contactByName = computed(() => { + const map = new Map(); + for (const contact of contacts.value) { + const key = (contact.name ?? "").trim(); + if (!key || map.has(key)) continue; + map.set(key, contact); + } + return map; +}); + +function avatarSrcForCalendarEvent(event: CalendarEvent) { + const contactName = String(event.contact ?? "").trim(); + if (!contactName) return ""; + const contact = contactByName.value.get(contactName); + if (!contact) return ""; + return avatarSrcForThread({ id: contact.id, avatar: contact.avatar }); +} + +function markCalendarAvatarBroken(event: CalendarEvent) { + const contactName = String(event.contact ?? "").trim(); + if (!contactName) return; + const contact = contactByName.value.get(contactName); + if (!contact) return; + markAvatarBroken(contact.id); +} + // --------------------------------------------------------------------------- // Auth display // --------------------------------------------------------------------------- @@ -1437,6 +1463,9 @@ onBeforeUnmount(() => { :focused-calendar-event="focusedCalendarEvent" :format-day="formatDay" :format-time="formatTime" + :avatar-src-for-calendar-event="avatarSrcForCalendarEvent" + :mark-calendar-avatar-broken="markCalendarAvatarBroken" + :contact-initials="contactInitials" :set-calendar-content-wrap-ref="setCalendarContentWrapRef" :shift-calendar="shiftCalendar" :set-calendar-content-scroll-ref="setCalendarContentScrollRef" diff --git a/frontend/app/components/workspace/calendar/CrmCalendarPanel.vue b/frontend/app/components/workspace/calendar/CrmCalendarPanel.vue index 63f8828..022db02 100644 --- a/frontend/app/components/workspace/calendar/CrmCalendarPanel.vue +++ b/frontend/app/components/workspace/calendar/CrmCalendarPanel.vue @@ -1,12 +1,5 @@