瀏覽代碼

fix: workflow delete edge (#3541)

tags/0.6.4
zxhlyh 1 年之前
父節點
當前提交
2e27425e93
No account linked to committer's email address
共有 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 查看文件



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


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

if (currentEdgeIndex > -1)
return

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



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

}, },
}) })


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

Loading…
取消
儲存