Skip to content

Commit

Permalink
Bugfix normal control after finish control
Browse files Browse the repository at this point in the history
Fixed a bug that allowed a normal control to be set after the finish control was placed.
  • Loading branch information
wlfrdssn authored Dec 26, 2024
1 parent 59c9140 commit 6cf823c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/tools/CreateCourse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 6cf823c

Please sign in to comment.