Skip to content

Commit 0295e00

Browse files
committed
front: fix timetable train selection
no train was selected after deleting the selected train
1 parent 51516f0 commit 0295e00

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

front/src/applications/operationalStudies/components/Scenario/getSimulationResults.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ export function selectProjection(
4343
const trainSchedulesIds = trainSchedules.map((train) => train.id);
4444

4545
// if the projected train still exists, keep it
46-
if (trainSchedulesIds.includes(currentProjection.id)) return;
46+
if (trainSchedulesIds.includes(currentProjection.id)) {
47+
if (!selectedTrainId) store.dispatch(updateSelectedTrainId(trainSchedules[0].id));
48+
return;
49+
}
4750

4851
// if the projected train has been deleted but an other train has the same path,
4952
// keep the path and select this train

0 commit comments

Comments
 (0)