From c0dd00749503c11d1338a4119dfe8ac6ab2d9ad4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cchrisshank=E2=80=9D?= Date: Wed, 23 Oct 2024 11:43:06 -0700 Subject: [PATCH] remove broken connections --- demo/chains-of-thought/main.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/demo/chains-of-thought/main.ts b/demo/chains-of-thought/main.ts index 3d2011e..3924965 100644 --- a/demo/chains-of-thought/main.ts +++ b/demo/chains-of-thought/main.ts @@ -33,6 +33,12 @@ class SpatialThought extends HTMLElement { handleEvent(event: PointerEvent): void { if (event.type === 'click' && event.target === this.#deleteButton) { this.#geometry.remove(); + document + .querySelectorAll( + `spatial-connection[source="spatial-geometry[id='${this.#geometry.id}']"], + spatial-connection[target="spatial-geometry[id='${this.#geometry.id}']"]` + ) + .forEach((el) => el.remove()); } } }