diff --git a/frontend/app/components/workspace/CrmWorkspaceApp.vue b/frontend/app/components/workspace/CrmWorkspaceApp.vue index d5d236e..88477e8 100644 --- a/frontend/app/components/workspace/CrmWorkspaceApp.vue +++ b/frontend/app/components/workspace/CrmWorkspaceApp.vue @@ -588,7 +588,7 @@ const threadStreamItems = computed(() => { return rows.sort((a, b) => a.at.localeCompare(b.at)); }); -// Sync call waves when thread stream changes +// Sync call waves when thread stream changes (flush: 'post' ensures DOM refs are registered) watch( () => threadStreamItems.value.map((entry: any) => `${entry.kind}:${entry.id}`).join("|"), () => { @@ -597,10 +597,15 @@ watch( .filter((entry: any) => entry.kind === "call") .map((entry: any) => entry.item.id as string), ); - const getCallItem = (id: string) => - visibleThreadItems.value.find((item) => item.id === id && item.kind === "call"); + const getCallItem = (id: string) => { + const timelineItem = clientTimelineItems.value.find( + (entry) => entry.contentType === "message" && entry.message?.id === id && entry.message?.kind === "call", + ); + return timelineItem?.message ?? undefined; + }; void _syncCommCallWavesRaw(activeCallIds, getCallItem); }, + { flush: "post" }, ); // ---------------------------------------------------------------------------