From 6a42e736674cc3b5722dbe72cd8a7eba996a4fea Mon Sep 17 00:00:00 2001 From: zhaoying Date: Fri, 6 Mar 2026 12:25:09 +0800 Subject: [PATCH] fix(web): Pre-generate attachment preview links --- web/src/components/Chat/ChatInput.tsx | 12 ++++++------ web/src/views/Conversation/components/FileUpload.tsx | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/web/src/components/Chat/ChatInput.tsx b/web/src/components/Chat/ChatInput.tsx index 49fb65d2..0e34561a 100644 --- a/web/src/components/Chat/ChatInput.tsx +++ b/web/src/components/Chat/ChatInput.tsx @@ -2,7 +2,7 @@ * @Author: ZhaoYing * @Date: 2025-12-10 16:46:14 * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-03-04 18:42:49 + * @Last Modified time: 2026-03-06 12:21:19 */ import { type FC, useEffect, useMemo } from 'react' import { Flex, Input, Form } from 'antd' @@ -56,7 +56,7 @@ const ChatInput: FC = ({ const previewFileList = useMemo(() => { return fileList?.map(file => ({ ...file, - url: file.url || (file.originFileObj ? URL.createObjectURL(file.originFileObj) : file.thumbUrl) + url: file.thumbUrl || file.url || (file.originFileObj ? URL.createObjectURL(file.originFileObj) : undefined) })) || [] }, [fileList]) @@ -72,7 +72,7 @@ const ChatInput: FC = ({ {previewFileList.map((file) => { if (file.type.includes('image')) { return ( -
+
{file.name}
= ({ } if (file.type.includes('video')) { return ( -
+