mirror of
https://gitee.com/dify_ai/dify.git
synced 2024-12-01 02:38:12 +08:00
fix: workflow restore (#3750)
This commit is contained in:
parent
ccaf335466
commit
a39de8a686
@ -19,7 +19,6 @@ import type {
|
||||
Viewport,
|
||||
} from 'reactflow'
|
||||
import {
|
||||
changeNodesAndEdgesId,
|
||||
getLayoutByDagre,
|
||||
initialEdges,
|
||||
initialNodes,
|
||||
@ -321,13 +320,13 @@ export const useWorkflow = () => {
|
||||
const renderTreeFromRecord = useCallback((nodes: Node[], edges: Edge[], viewport?: Viewport) => {
|
||||
const { setViewport } = reactflow
|
||||
|
||||
const [newNodes, newEdges] = changeNodesAndEdgesId(nodes, edges)
|
||||
const nodesMap = nodes.map(node => ({ ...node, data: { ...node.data, selected: false } }))
|
||||
|
||||
eventEmitter?.emit({
|
||||
type: WORKFLOW_DATA_UPDATE,
|
||||
payload: {
|
||||
nodes: initialNodes(newNodes, newEdges),
|
||||
edges: initialEdges(newEdges, newNodes),
|
||||
nodes: initialNodes(nodesMap, edges),
|
||||
edges: initialEdges(edges, nodesMap),
|
||||
},
|
||||
} as any)
|
||||
|
||||
|
@ -23,6 +23,7 @@ const Panel: FC = () => {
|
||||
const showInputsPanel = useStore(s => s.showInputsPanel)
|
||||
const workflowRunningData = useStore(s => s.workflowRunningData)
|
||||
const historyWorkflowData = useStore(s => s.historyWorkflowData)
|
||||
const isRestoring = useStore(s => s.isRestoring)
|
||||
const { currentLogItem, setCurrentLogItem, showMessageLogModal, setShowMessageLogModal } = useAppStore(useShallow(state => ({
|
||||
currentLogItem: state.currentLogItem,
|
||||
setCurrentLogItem: state.setCurrentLogItem,
|
||||
@ -48,7 +49,7 @@ const Panel: FC = () => {
|
||||
])
|
||||
|
||||
return (
|
||||
<div className='absolute top-14 right-0 bottom-2 flex z-10'>
|
||||
<div className='absolute top-14 right-0 bottom-2 flex z-10' key={`${isRestoring}`}>
|
||||
{
|
||||
showMessageLogModal && (
|
||||
<MessageLogModal
|
||||
|
Loading…
Reference in New Issue
Block a user