From 271c6955999903a8cc98a7e6d6491132eeb31266 Mon Sep 17 00:00:00 2001 From: bindeali <56399637+bindeali@users.noreply.github.com> Date: Thu, 12 Sep 2024 16:17:27 +0200 Subject: [PATCH] Allow creation of connections even with one term on canvas --- src/main/DiagramCanvas.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/DiagramCanvas.tsx b/src/main/DiagramCanvas.tsx index 7edb1446..39eec633 100644 --- a/src/main/DiagramCanvas.tsx +++ b/src/main/DiagramCanvas.tsx @@ -248,12 +248,10 @@ export default class DiagramCanvas extends React.Component { ...getElementToolPosition(id), action: (evt: { currentTarget: { getAttribute: (arg0: string) => any }; - }) => { - if (graph.getElements().length > 1) - this.createNewLink( - evt.currentTarget.getAttribute("model-id") - ); - }, + }) => + this.createNewLink( + evt.currentTarget.getAttribute("model-id") + ), }), tool, ],