From 40e5a4b04b0cd5f2bd917f1a6a1c064320d56239 Mon Sep 17 00:00:00 2001 From: itwillwork Date: Fri, 29 Nov 2024 14:46:37 +0300 Subject: [PATCH] fix canCreateNewConnections config flag --- src/services/newConnection/ConnectionService.ts | 8 ++++---- src/stories/Playground/GraphPlayground.tsx | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/services/newConnection/ConnectionService.ts b/src/services/newConnection/ConnectionService.ts index d51b44e..7f4f0bb 100644 --- a/src/services/newConnection/ConnectionService.ts +++ b/src/services/newConnection/ConnectionService.ts @@ -77,10 +77,10 @@ export class ConnectionService extends Emitter { return; } if ( - (this.graph.rootStore.settings.getConfigFlag("useBlocksAnchors") && target instanceof Anchor) || - (isShiftKeyEvent(event) && - isBlock(target) && - this.graph.rootStore.settings.getConfigFlag("canCreateNewConnections")) + ( + (this.graph.rootStore.settings.getConfigFlag("useBlocksAnchors") && target instanceof Anchor) || + (isShiftKeyEvent(event) && isBlock(target)) + ) && this.graph.rootStore.settings.getConfigFlag("canCreateNewConnections") ) { nativeEvent.preventDefault(); nativeEvent.stopPropagation(); diff --git a/src/stories/Playground/GraphPlayground.tsx b/src/stories/Playground/GraphPlayground.tsx index f066791..979ce3d 100644 --- a/src/stories/Playground/GraphPlayground.tsx +++ b/src/stories/Playground/GraphPlayground.tsx @@ -73,7 +73,7 @@ const config: HookGraphParams = { canZoomCamera: true, canDuplicateBlocks: false, canChangeBlockGeometry: ECanChangeBlockGeometry.ALL, - canCreateNewConnections: false, + canCreateNewConnections: true, showConnectionArrows: false, scaleFontSize: 1, useBezierConnections: true,