From cbe8133b28e2a4a2754675273a2a2a39f1d44ddd Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 20 Nov 2025 09:09:13 +0100 Subject: [PATCH] fix: do not add empty segment when creating empty segmentations --- .../segmentation/internalAddSegmentationRepresentation.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/tools/src/stateManagement/segmentation/internalAddSegmentationRepresentation.ts b/packages/tools/src/stateManagement/segmentation/internalAddSegmentationRepresentation.ts index 013988f1b..188aa751e 100644 --- a/packages/tools/src/stateManagement/segmentation/internalAddSegmentationRepresentation.ts +++ b/packages/tools/src/stateManagement/segmentation/internalAddSegmentationRepresentation.ts @@ -54,8 +54,8 @@ function internalAddSegmentationRepresentation( const segmentKeys = Object.keys(segmentation.segments); if (segmentKeys.length > 0) { firstSegmentIndex = segmentKeys.map((k) => Number(k)).sort()[0]; + setActiveSegmentIndex(segmentationId, firstSegmentIndex); } - setActiveSegmentIndex(segmentationId, firstSegmentIndex); } }