mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-07 01:46:49 +08:00
fix: send message error when last sent message not succeeded (#8682)
This commit is contained in:
@@ -19,6 +19,15 @@ function getProcessedInputsFromUrlParams(): Record<string, any> {
|
||||
return inputs
|
||||
}
|
||||
|
||||
function getLastAnswer(chatList: ChatItem[]) {
|
||||
for (let i = chatList.length - 1; i >= 0; i--) {
|
||||
const item = chatList[i]
|
||||
if (item.isAnswer && !item.isOpeningStatement)
|
||||
return item
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
function appendQAToChatList(chatList: ChatItem[], item: any) {
|
||||
// we append answer first and then question since will reverse the whole chatList later
|
||||
chatList.push({
|
||||
@@ -71,5 +80,6 @@ function getPrevChatList(fetchedMessages: any[]) {
|
||||
|
||||
export {
|
||||
getProcessedInputsFromUrlParams,
|
||||
getLastAnswer,
|
||||
getPrevChatList,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user