瀏覽代碼

fix: workflow delete edge (#3541)

tags/0.6.4
zxhlyh 1 年之前
父節點
當前提交
2e27425e93
沒有連結到貢獻者的電子郵件帳戶。
共有 2 個檔案被更改,包括 7 行新增1 行删除
  1. 6
    0
      web/app/components/workflow/hooks/use-nodes-interactions.ts
  2. 1
    1
      web/app/components/workflow/index.tsx

+ 6
- 0
web/app/components/workflow/hooks/use-nodes-interactions.ts 查看文件

@@ -820,8 +820,14 @@ export const useNodesInteractions = () => {

const {
getNodes,
edges,
} = store.getState()

const currentEdgeIndex = edges.findIndex(edge => edge.selected)

if (currentEdgeIndex > -1)
return

const nodes = getNodes()
const nodesToDelete = nodes.filter(node => node.data.selected)


+ 1
- 1
web/app/components/workflow/index.tsx 查看文件

@@ -137,8 +137,8 @@ const Workflow: FC<WorkflowProps> = memo(({
},
})

useKeyPress(['delete'], handleEdgeDelete)
useKeyPress(['delete', 'backspace'], handleNodeDeleteSelected)
useKeyPress(['delete', 'backspace'], handleEdgeDelete)
useKeyPress(['ctrl.c', 'meta.c'], handleNodeCopySelected)
useKeyPress(['ctrl.x', 'meta.x'], handleNodeCut)
useKeyPress(['ctrl.v', 'meta.v'], handleNodePaste)

Loading…
取消
儲存