Skip to content

Commit d245d8f

Browse files
committed
fix last issue
1 parent 3e7980f commit d245d8f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

front/src/applications/editor/tools/trackEdition/components.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ export const TrackEditionLeftPanel: FC = () => {
447447
}
448448
setState({
449449
...state,
450-
track: { ...(checkedTrack as TrackSectionEntity) },
450+
track: checkedTrack as TrackSectionEntity,
451451
});
452452
}}
453453
>

front/src/applications/editor/tools/trackEdition/utils.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@ export function injectGeometry(track: EditorEntity): EditorEntity {
3333

3434
/**
3535
* Remove the invalid ranges when the length of the track section has been modified
36+
* - keep ranges if begin is undefined in case we just added a new one or if we deleted the begin input value
3637
* - remove ranges which start after the new end
3738
* - cut the ranges which start before the new end but end after it
3839
*/
3940
export function removeInvalidRanges<T>(values: LinearMetadataItem<T>[], newLength: number) {
4041
return values
41-
.filter((item) => item.begin < newLength)
42+
.filter((item) => item.begin < newLength || !item.begin)
4243
.map((item) => (item.end >= newLength ? { ...item, end: newLength } : item));
4344
}

0 commit comments

Comments
 (0)