From 8e085a718f562fa94dead3b1c863dd0bd28632ac Mon Sep 17 00:00:00 2001 From: vcoppe Date: Fri, 24 May 2024 19:00:26 +0200 Subject: [PATCH] fix routing controls add/update logic --- .../toolbar/tools/routing/RoutingControls.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/website/src/lib/components/toolbar/tools/routing/RoutingControls.ts b/website/src/lib/components/toolbar/tools/routing/RoutingControls.ts index 55611708..cf77f450 100644 --- a/website/src/lib/components/toolbar/tools/routing/RoutingControls.ts +++ b/website/src/lib/components/toolbar/tools/routing/RoutingControls.ts @@ -59,10 +59,14 @@ export class RoutingControls { return; } - let selected = get(selection).hasAnyChildren(new ListFileItem(this.fileId), true, ['waypoints']); + let selected = get(selection).hasAnyChildren(new ListFileItem(this.fileId), true, ['waypoints']) && get(selection).size == 1; if (selected) { - this.add(); - } else if (!selected && this.active) { + if (this.active) { + this.updateControls(); + } else { + this.add(); + } + } else if (this.active) { this.remove(); } }