mirror of https://github.com/langgenius/dify.git
fix: the try app always use the curent conversation
This commit is contained in:
parent
949bf38d3c
commit
0957ece92f
|
|
@ -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 (
|
||||
<Chat
|
||||
isTryApp={appSourceType === AppSourceType.tryApp}
|
||||
isTryApp={isTryApp}
|
||||
appData={appData || undefined}
|
||||
config={appConfig}
|
||||
chatList={messageList}
|
||||
|
|
|
|||
|
|
@ -117,8 +117,8 @@ export const useEmbeddedChatbot = (appSourceType: AppSourceType, tryAppId?: stri
|
|||
defaultValue: {},
|
||||
})
|
||||
const allowResetChat = !conversationId
|
||||
const currentConversationId = useMemo(() => 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 || '']
|
||||
|
|
|
|||
Loading…
Reference in New Issue