mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-13 20:35:55 +08:00
fix: chatflow run progress problem (#4298)
This commit is contained in:
parent
20a9037d5b
commit
c01c95d77f
@ -468,7 +468,10 @@ export const useChat = (
|
|||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
onNodeStarted: ({ data }) => {
|
onNodeStarted: ({ data }) => {
|
||||||
responseItem.workflowProcess!.tracing!.push(data as any)
|
responseItem.workflowProcess!.tracing!.push({
|
||||||
|
...data,
|
||||||
|
status: WorkflowRunningStatus.Running,
|
||||||
|
} as any)
|
||||||
handleUpdateChatList(produce(chatListRef.current, (draft) => {
|
handleUpdateChatList(produce(chatListRef.current, (draft) => {
|
||||||
const currentIndex = draft.findIndex(item => item.id === responseItem.id)
|
const currentIndex = draft.findIndex(item => item.id === responseItem.id)
|
||||||
draft[currentIndex] = {
|
draft[currentIndex] = {
|
||||||
|
@ -7,7 +7,7 @@ import {
|
|||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { produce, setAutoFreeze } from 'immer'
|
import { produce, setAutoFreeze } from 'immer'
|
||||||
import { useWorkflowRun } from '../../hooks'
|
import { useWorkflowRun } from '../../hooks'
|
||||||
import { WorkflowRunningStatus } from '../../types'
|
import { NodeRunningStatus, WorkflowRunningStatus } from '../../types'
|
||||||
import type {
|
import type {
|
||||||
ChatItem,
|
ChatItem,
|
||||||
Inputs,
|
Inputs,
|
||||||
@ -173,7 +173,7 @@ export const useChat = (
|
|||||||
|
|
||||||
// answer
|
// answer
|
||||||
const responseItem: ChatItem = {
|
const responseItem: ChatItem = {
|
||||||
id: `${Date.now()}`,
|
id: placeholderAnswerId,
|
||||||
content: '',
|
content: '',
|
||||||
agent_thoughts: [],
|
agent_thoughts: [],
|
||||||
message_files: [],
|
message_files: [],
|
||||||
@ -298,7 +298,10 @@ export const useChat = (
|
|||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
onNodeStarted: ({ data }) => {
|
onNodeStarted: ({ data }) => {
|
||||||
responseItem.workflowProcess!.tracing!.push(data as any)
|
responseItem.workflowProcess!.tracing!.push({
|
||||||
|
...data,
|
||||||
|
status: NodeRunningStatus.Running,
|
||||||
|
} as any)
|
||||||
handleUpdateChatList(produce(chatListRef.current, (draft) => {
|
handleUpdateChatList(produce(chatListRef.current, (draft) => {
|
||||||
const currentIndex = draft.findIndex(item => item.id === responseItem.id)
|
const currentIndex = draft.findIndex(item => item.id === responseItem.id)
|
||||||
draft[currentIndex] = {
|
draft[currentIndex] = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user