Skip to content

Commit e2e721b

Browse files
committed
front: handle occurences in times stops table name
Signed-off-by: Theo Macron <theo.macron0315@gmail.com>
1 parent f52ef36 commit e2e721b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

front/src/applications/operationalStudies/hooks/useSimulationResults.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
extractOccurrenceDetailsFromPacedTrain,
1111
findExceptionWithOccurrenceId,
1212
computeIndexedOccurrenceStartTime,
13+
getOccurrenceTrainName,
1314
} from 'modules/timetableItem/helpers/pacedTrain';
1415
import useSelectedTimetableItem from 'modules/timetableItem/hooks/useSelectedTimetableItem';
1516
import type { Train } from 'reducers/osrdconf/types';
@@ -67,6 +68,11 @@ const useSimulationResults = (): {
6768
...(exception ? extractOccurrenceDetailsFromPacedTrain(timetableItem, exception) : {}),
6869
// overwrite start_time from extractOccurrenceDetailsFromPacedTrain
6970
start_time: startTime,
71+
// overwrite train_name to reflect the occurrence name
72+
train_name: getOccurrenceTrainName(
73+
{ ...timetableItem, paced: timetableItem.paced },
74+
selectedTrainId
75+
),
7076
id: selectedTrainId,
7177
};
7278
}, [selectedTrainId, timetableItem]);

0 commit comments

Comments
 (0)