Commit 876dccc 1 parent 6690d02 commit 876dccc Copy full SHA for 876dccc
File tree 1 file changed +6
-9
lines changed
front/src/modules/timesStops/helpers
1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -12,18 +12,15 @@ export function getTheoreticalMargins(selectedTrainSchedule: TrainScheduleResult
12
12
const theoreticalMargins : TheoreticalMarginsRecord = { } ;
13
13
let marginIndex = 0 ;
14
14
selectedTrainSchedule . path . forEach ( ( step , index ) => {
15
+ let isBoundary = index === 0 ;
15
16
if ( step . id === selectedTrainSchedule . margins ?. boundaries [ marginIndex ] ) {
16
17
marginIndex += 1 ;
17
- theoreticalMargins [ step . id ] = {
18
- theoreticalMargin : selectedTrainSchedule . margins ?. values [ marginIndex ] ,
19
- isBoundary : true ,
20
- } ;
21
- } else {
22
- theoreticalMargins [ step . id ] = {
23
- theoreticalMargin : selectedTrainSchedule . margins ?. values [ marginIndex ] ,
24
- isBoundary : index === 0 ,
25
- } ;
18
+ isBoundary = true ;
26
19
}
20
+ theoreticalMargins [ step . id ] = {
21
+ theoreticalMargin : selectedTrainSchedule . margins ?. values [ marginIndex ] ,
22
+ isBoundary,
23
+ } ;
27
24
} ) ;
28
25
return theoreticalMargins ;
29
26
}
You can’t perform that action at this time.
0 commit comments