fix(web): app bugfix

This commit is contained in:
zhaoying
2026-03-18 14:36:23 +08:00
parent 969d428320
commit 4bb2ccfba7
4 changed files with 25 additions and 14 deletions

View File

@@ -193,7 +193,10 @@ const TestChat: FC<TestChatProps> = ({
formatParams(message, conversationId, files, params),
handleStreamMessage
)
.catch(() => setLoading(false))
.catch(() => {
updateErrorAssistantMessage(0)
setLoading(false)
})
.finally(() => {
setLoading(false)
setStreamLoading(false)
@@ -243,11 +246,12 @@ const TestChat: FC<TestChatProps> = ({
handleWorkflowStreamMessage
)
.catch((error) => {
const errorInfo = JSON.parse(error.message)
setChatList(prev => {
const newList = [...prev]
const lastIndex = newList.length - 1
if (lastIndex >= 0) {
newList[lastIndex] = { ...newList[lastIndex], status: 'failed', content: null, subContent: error.error }
newList[lastIndex] = { ...newList[lastIndex], status: 'failed', content: null, subContent: errorInfo.error }
}
return newList
})