From 3f2248658617337d9e64909d24f804d6eaa06c03 Mon Sep 17 00:00:00 2001 From: aries_ckt <916701291@qq.com> Date: Tue, 12 May 2026 18:51:07 +0800 Subject: [PATCH] chore:fmt --- web/pages/chat/index.tsx | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/web/pages/chat/index.tsx b/web/pages/chat/index.tsx index d70a3c4c8..3f6bd0b6a 100644 --- a/web/pages/chat/index.tsx +++ b/web/pages/chat/index.tsx @@ -128,7 +128,7 @@ const Chat: React.FC = () => { }, 500); return () => clearTimeout(timer); } - }, [initMsg, chatId, history.length, replyLoading]); + }, [chatId, handleChat, history.length, initMsg, replyLoading]); useEffect(() => { setTemperatureValue(appInfo?.param_need?.filter(item => item.type === 'temperature')[0]?.value || 0.6); @@ -212,7 +212,7 @@ const Chat: React.FC = () => { // 会话提问 const handleChat = useCallback( (content: UserChatContent, data?: Record) => { - return new Promise(async resolve => { + return new Promise(resolve => { const initMessage = getInitMessage(); setReplyLoading(true); if (history && history.length > 0) { @@ -221,16 +221,6 @@ const Chat: React.FC = () => { order.current = (viewList[viewList.length - 1]?.order || humanList[humanList.length - 1]?.order) + 1; } - // Extract display-friendly text from content - let userInputStr: string; - if (typeof content === 'string') { - userInputStr = content; - } else { - const contentItems = content.content || []; - const textItems = contentItems.filter(item => item.type === 'text'); - userInputStr = textItems.map(item => item.text).join(' '); - } - // Process content for display formatting let formattedDisplayContent: string = ''; @@ -342,7 +332,7 @@ const Chat: React.FC = () => { }); }); }, - [chatId, history, modelValue, chat, scene, currentDialogInfo], + [chat, chatId, history, modelValue, scene], ); useAsyncEffect(async () => {