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>
This commit is contained in:
parent
17b929124f
commit
e040f8069b
1 changed files with 7 additions and 2 deletions
|
|
@ -37,8 +37,13 @@ export type WorkflowSliceShape = {
|
||||||
export const createWorkflowSlice: StateCreator<WorkflowSliceShape> = set => ({
|
export const createWorkflowSlice: StateCreator<WorkflowSliceShape> = set => ({
|
||||||
workflowRunningData: undefined,
|
workflowRunningData: undefined,
|
||||||
setWorkflowRunningData: workflowRunningData => set(() => ({ workflowRunningData })),
|
setWorkflowRunningData: workflowRunningData => set(() => ({ workflowRunningData })),
|
||||||
clipboardElements: [],
|
clipboardElements: (() => {
|
||||||
setClipboardElements: clipboardElements => set(() => ({ clipboardElements })),
|
const storedElements = localStorage.getItem('clipboard_elements')
|
||||||
|
return storedElements ? JSON.parse(storedElements) : []
|
||||||
|
})(),
|
||||||
|
setClipboardElements: (clipboardElements) => {
|
||||||
|
localStorage.setItem('clipboard_elements', JSON.stringify(clipboardElements))
|
||||||
|
},
|
||||||
selection: null,
|
selection: null,
|
||||||
setSelection: selection => set(() => ({ selection })),
|
setSelection: selection => set(() => ({ selection })),
|
||||||
bundleNodeSize: null,
|
bundleNodeSize: null,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue