From 845bae284f2c6804c681a7a54a970ce42b289dfa Mon Sep 17 00:00:00 2001 From: moklick Date: Fri, 4 Oct 2019 22:43:19 +0200 Subject: [PATCH] refacor(keypresshook): cleanup --- src/graph-utils.js | 1 + src/hooks/useKeyPress.js | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/graph-utils.js b/src/graph-utils.js index f932af22..821c5698 100644 --- a/src/graph-utils.js +++ b/src/graph-utils.js @@ -129,6 +129,7 @@ export const getNodesInside = (nodes, bbox, transform = [0, 0, 1], partially = f export const getConnectedEdges = (nodes, edges) => { const nodeIds = nodes.map(n => n.id); + return edges.filter(e => { const hasSourceHandleId = e.source.includes('__'); const hasTargetHandleId = e.target.includes('__'); diff --git a/src/hooks/useKeyPress.js b/src/hooks/useKeyPress.js index 32a563ad..442a2d52 100644 --- a/src/hooks/useKeyPress.js +++ b/src/hooks/useKeyPress.js @@ -6,7 +6,6 @@ export default function useKeyPress(keyCode) { const [keyPressed, setKeyPressed] = useState(false); function downHandler(evt) { - console.log(keyCode, evt.keyCode); if (evt.keyCode === keyCode && !isInputNode(evt.target)) { setKeyPressed(true); }