fix: Default value for input variable is null when starting new conversations on the web app (#24709)
This commit is contained in:
@@ -407,9 +407,13 @@ export const useChatWithHistory = (installedAppInfo?: InstalledApp) => {
|
|||||||
currentChatInstanceRef.current.handleStop()
|
currentChatInstanceRef.current.handleStop()
|
||||||
setShowNewConversationItemInList(true)
|
setShowNewConversationItemInList(true)
|
||||||
handleChangeConversation('')
|
handleChangeConversation('')
|
||||||
handleNewConversationInputsChange(await getRawInputsFromUrlParams())
|
const conversationInputs: Record<string, any> = {}
|
||||||
|
inputsForms.forEach((item: any) => {
|
||||||
|
conversationInputs[item.variable] = item.default || null
|
||||||
|
})
|
||||||
|
handleNewConversationInputsChange(conversationInputs)
|
||||||
setClearChatList(true)
|
setClearChatList(true)
|
||||||
}, [handleChangeConversation, setShowNewConversationItemInList, handleNewConversationInputsChange, setClearChatList])
|
}, [handleChangeConversation, setShowNewConversationItemInList, handleNewConversationInputsChange, setClearChatList, inputsForms])
|
||||||
const handleUpdateConversationList = useCallback(() => {
|
const handleUpdateConversationList = useCallback(() => {
|
||||||
mutateAppConversationData()
|
mutateAppConversationData()
|
||||||
mutateAppPinnedConversationData()
|
mutateAppPinnedConversationData()
|
||||||
|
Reference in New Issue
Block a user