Commit cda6a09 Alice K.
committed
1 parent c38d369 commit cda6a09 Copy full SHA for cda6a09
File tree 1 file changed +8
-2
lines changed
front/src/modules/trainschedule/components/ManageTrainSchedule/ManageTrainScheduleMap
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -21,10 +21,16 @@ export function setPointIti(
21
21
newPathSteps = replaceElementAtIndex ( pathSteps , 0 , pathStep ) ;
22
22
break ;
23
23
case 'destination' :
24
- newPathSteps = replaceElementAtIndex ( pathSteps , - 1 , pathStep ) ;
24
+ if ( pathSteps . length === 1 ) {
25
+ newPathSteps = addElementAtIndex ( pathSteps , pathSteps . length , pathStep ) ;
26
+ } else {
27
+ newPathSteps = replaceElementAtIndex ( pathSteps , pathSteps . length - 1 , pathStep ) ;
28
+ }
25
29
break ;
26
30
default :
27
- if ( pathProperties ) {
31
+ if ( pathSteps . length === 1 ) {
32
+ newPathSteps = addElementAtIndex ( pathSteps , pathSteps . length , pathStep ) ;
33
+ } else if ( pathProperties ) {
28
34
newPathSteps = insertViaFromMap ( pathSteps , pathStep , pathProperties ) ;
29
35
} else {
30
36
newPathSteps = addElementAtIndex ( pathSteps , pathSteps . length - 1 , pathStep ) ;
You can’t perform that action at this time.
0 commit comments