浏览代码

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 个月前
父节点
当前提交
e040f8069b
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. 7
    2
      web/app/components/workflow/store/workflow/workflow-slice.ts

+ 7
- 2
web/app/components/workflow/store/workflow/workflow-slice.ts 查看文件

@@ -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,

正在加载...
取消
保存