From 2efeb8c51ee66916d352dfd69cb0e875184d9da4 Mon Sep 17 00:00:00 2001 From: Mutasem Date: Fri, 5 Nov 2021 14:00:34 +0100 Subject: [PATCH] add more checks --- packages/editor-ui/src/views/NodeView.vue | 13 +++++++------ packages/editor-ui/src/views/canvasHelpers.ts | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/editor-ui/src/views/NodeView.vue b/packages/editor-ui/src/views/NodeView.vue index f4185a2b85..12b753229f 100644 --- a/packages/editor-ui/src/views/NodeView.vue +++ b/packages/editor-ui/src/views/NodeView.vue @@ -1369,7 +1369,7 @@ export default mixins( return; } - if (info.connection === activeConnection) { + if (!info.connection || info.connection === activeConnection) { return; } @@ -1378,9 +1378,10 @@ export default mixins( enterTimer = setTimeout(() => { enterTimer = undefined; - activeConnection = info.connection; - CanvasHelpers.showConectionActions(info.connection); - + if (info.connection) { + activeConnection = info.connection; + CanvasHelpers.showConectionActions(info.connection); + } }, 150); } catch (e) { console.error(e); @@ -1398,14 +1399,14 @@ export default mixins( enterTimer = undefined; } - if (activeConnection !== info.connection) { + if (!info.connection || activeConnection !== info.connection) { return; } exitTimer = setTimeout(() => { exitTimer = undefined; - if (activeConnection === info.connection) { + if (info.connection && activeConnection === info.connection) { CanvasHelpers.hideConnectionActions(activeConnection); activeConnection = null; } diff --git a/packages/editor-ui/src/views/canvasHelpers.ts b/packages/editor-ui/src/views/canvasHelpers.ts index a9c36bdb7c..0e9ef30672 100644 --- a/packages/editor-ui/src/views/canvasHelpers.ts +++ b/packages/editor-ui/src/views/canvasHelpers.ts @@ -380,7 +380,7 @@ export const getBackgroundStyles = (scale: number, offsetPosition: XYPosition) = }; export const hideConnectionActions = (connection: Connection | null) => { - if (connection) { + if (connection && connection.connector) { hideOverlay(connection, OVERLAY_CONNECTION_ACTIONS_ID); showOrHideItemsLabel(connection); showOrHideMidpointArrow(connection); @@ -388,7 +388,7 @@ export const hideConnectionActions = (connection: Connection | null) => { }; export const showConectionActions = (connection: Connection | null) => { - if (connection) { + if (connection && connection.connector) { showOverlay(connection, OVERLAY_CONNECTION_ACTIONS_ID); hideOverlay(connection, OVERLAY_RUN_ITEMS_ID); if (!getOverlay(connection, OVERLAY_RUN_ITEMS_ID)) {