Browse Source

Support for copying nodes between workflows (This feature is unrelated to remove functions. When using the copy function, the browser will permanently retain the last copied node)." (#19687)

Co-authored-by: crazywoola <427733928@qq.com>
tags/1.4.0
FyhSky 5 months ago
parent
commit
e040f8069b
No account linked to committer's email address
1 changed files with 7 additions and 2 deletions
  1. 7
    2
      web/app/components/workflow/store/workflow/workflow-slice.ts

+ 7
- 2
web/app/components/workflow/store/workflow/workflow-slice.ts View File

@@ -37,8 +37,13 @@ export type WorkflowSliceShape = {
export const createWorkflowSlice: StateCreator<WorkflowSliceShape> = set => ({
workflowRunningData: undefined,
setWorkflowRunningData: workflowRunningData => set(() => ({ workflowRunningData })),
clipboardElements: [],
setClipboardElements: clipboardElements => set(() => ({ clipboardElements })),
clipboardElements: (() => {
const storedElements = localStorage.getItem('clipboard_elements')
return storedElements ? JSON.parse(storedElements) : []
})(),
setClipboardElements: (clipboardElements) => {
localStorage.setItem('clipboard_elements', JSON.stringify(clipboardElements))
},
selection: null,
setSelection: selection => set(() => ({ selection })),
bundleNodeSize: null,

Loading…
Cancel
Save