From 0957ece92f6a5b480aac09be687b7ade6c1ceb9e Mon Sep 17 00:00:00 2001 From: Joel Date: Fri, 24 Oct 2025 15:57:33 +0800 Subject: [PATCH] fix: the try app always use the curent conversation --- .../components/base/chat/embedded-chatbot/chat-wrapper.tsx | 5 +++-- web/app/components/base/chat/embedded-chatbot/hooks.tsx | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/web/app/components/base/chat/embedded-chatbot/chat-wrapper.tsx b/web/app/components/base/chat/embedded-chatbot/chat-wrapper.tsx index 0f2c4627e2..be0e36156e 100644 --- a/web/app/components/base/chat/embedded-chatbot/chat-wrapper.tsx +++ b/web/app/components/base/chat/embedded-chatbot/chat-wrapper.tsx @@ -167,7 +167,8 @@ const ChatWrapper = () => { return chatList.filter(item => !item.isOpeningStatement) }, [chatList, currentConversationId]) - const [collapsed, setCollapsed] = useState(!!currentConversationId) + const isTryApp = appSourceType === AppSourceType.tryApp + const [collapsed, setCollapsed] = useState(!!currentConversationId && !isTryApp) // try app always use the new chat const chatNode = useMemo(() => { if (allInputsHidden || !inputsForms.length) @@ -240,7 +241,7 @@ const ChatWrapper = () => { return ( conversationIdInfo?.[appId || '']?.[userId || 'DEFAULT'] || conversationId || '', - [appId, conversationIdInfo, userId, conversationId]) + const currentConversationId = useMemo(() => isTryApp ? '' : conversationIdInfo?.[appId || '']?.[userId || 'DEFAULT'] || conversationId || '', + [isTryApp, appId, conversationIdInfo, userId, conversationId]) const handleConversationIdInfoChange = useCallback((changeConversationId: string) => { if (appId) { let prevValue = conversationIdInfo?.[appId || '']