Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

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)

FyhSkye040f8069b47
diff --git a/web/app/components/workflow/store/workflow/workflow-slice.ts b/web/app/components/workflow/store/workflow/workflow-slice.ts
index 6bb69cdfcdc..e1f2fd91c5b 100644
--- a/web/app/components/workflow/store/workflow/workflow-slice.ts
+++ b/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,