fix: Default value for input variable is null when starting new conversations on the web app (#24709)
This commit is contained in:
parent
5c01dd97e8
commit
5a64f69456
1 changed files with 6 additions and 2 deletions
|
|
@ -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()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue