Skip to content

Commit bbab3bb

Browse files
authored
fix: fix convert to flux bug (#4231)
1 parent dcc9ee3 commit bbab3bb

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/flows/context/flow.current.tsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -360,23 +360,22 @@ export const FlowProvider: FC = ({children}) => {
360360
return
361361
}
362362

363-
const flowCopy = JSON.parse(JSON.stringify(currentFlow))
364-
365-
flowCopy.data.byID[id] = initial
366-
flowCopy.meta.byID[id] = {
363+
currentFlow.data.byID[id] = initial
364+
currentFlow.meta.byID[id] = {
367365
title,
368366
visible: true,
369367
}
370368

371369
if (typeof index !== 'undefined') {
372-
flowCopy.data.allIDs.splice(index + 1, 0, id)
373-
flowCopy.meta.allIDs.splice(index + 1, 0, id)
370+
currentFlow.data.allIDs.splice(index + 1, 0, id)
371+
currentFlow.meta.allIDs.splice(index + 1, 0, id)
374372
} else {
375-
flowCopy.data.allIDs.push(id)
376-
flowCopy.meta.allIDs.push(id)
373+
currentFlow.data.allIDs.push(id)
374+
currentFlow.meta.allIDs.push(id)
377375
}
378376

379-
update(flowCopy)
377+
updateData(id, {})
378+
updateMeta(id, {})
380379

381380
return id
382381
}

0 commit comments

Comments
 (0)