diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx index 1b029584a4c5f6e09db6f571bf90846bc4e546c4..23a6c4f18666b42d0f121f7eb606231b2e6cfbee 100644 --- a/apps/web/src/components/ChatView.tsx +++ b/apps/web/src/components/ChatView.tsx @@ -710,8 +710,13 @@ export default function ChatView({ threadId }: ChatViewProps) { } let changed = false; - const attachments = message.attachments.map((attachment, index) => { - const handoffPreviewUrl = handoffPreviewUrls[index]; + let imageIndex = 0; + const attachments = message.attachments.map((attachment) => { + if (attachment.type !== "image") { + return attachment; + } + const handoffPreviewUrl = handoffPreviewUrls[imageIndex]; + imageIndex += 1; if (!handoffPreviewUrl || attachment.previewUrl === handoffPreviewUrl) { return attachment; }