From 6cf823c92d8b198d0743e052d28044c118d1e33c Mon Sep 17 00:00:00 2001 From: wlfrdssn <61554783+wlfrdssn@users.noreply.github.com> Date: Thu, 26 Dec 2024 16:03:46 +0100 Subject: [PATCH] Bugfix normal control after finish control Fixed a bug that allowed a normal control to be set after the finish control was placed. --- src/tools/CreateCourse.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/tools/CreateCourse.tsx b/src/tools/CreateCourse.tsx index fdd1a01..d18d67e 100644 --- a/src/tools/CreateCourse.tsx +++ b/src/tools/CreateCourse.tsx @@ -146,6 +146,15 @@ export default function CreateCourse(): JSX.Element { addControl({ ...control }, selectedCourseId); } else { const numberControls = controlsSource.getFeatures().length; + + const hasFinishControl = controlsSource.getFeatures().some( + (feature) => feature.get("kind") === "finish" + ); + + if (hasFinishControl) { + return; + } + const kind = activeModeRef.current === "Finish" ? "finish"