fix: send message error when chatting with opening statement (#8627)
This commit is contained in:
@@ -69,11 +69,17 @@ const ChatWrapper = () => {
|
||||
}, [])
|
||||
|
||||
const doSend: OnSend = useCallback((message, files, last_answer) => {
|
||||
const lastAnswer = chatListRef.current.at(-1)
|
||||
|
||||
const data: any = {
|
||||
query: message,
|
||||
inputs: currentConversationId ? currentConversationItem?.inputs : newConversationInputs,
|
||||
conversation_id: currentConversationId,
|
||||
parent_message_id: last_answer?.id || chatListRef.current.at(-1)?.id || null,
|
||||
parent_message_id: last_answer?.id || (lastAnswer
|
||||
? lastAnswer.isOpeningStatement
|
||||
? null
|
||||
: lastAnswer.id
|
||||
: null),
|
||||
}
|
||||
|
||||
if (appConfig?.file_upload?.image.enabled && files?.length)
|
||||
|
Reference in New Issue
Block a user