File tree Expand file tree Collapse file tree 1 file changed +16
-10
lines changed
Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -562,18 +562,10 @@ const SelectLineScreen = () => {
562562
563563 setIsSelectBoundModalOpen ( true ) ;
564564
565- const result = await fetchStationsByLineId ( {
566- variables : { lineId, stationId : lineStationId } ,
567- } ) ;
568- const fetchedStations = result . data ?. lineStations ?? [ ] ;
569-
570- const pendingStation =
571- fetchedStations . find ( ( s ) => s . id === lineStationId ) ?? null ;
572-
573565 setStationState ( ( prev ) => ( {
574566 ...prev ,
575- pendingStation,
576- pendingStations : fetchedStations ,
567+ pendingStation : null ,
568+ pendingStations : [ ] ,
577569 selectedDirection : null ,
578570 wantedDestination : null ,
579571 selectedBound : null ,
@@ -589,6 +581,20 @@ const SelectLineScreen = () => {
589581 pendingTrainType : null ,
590582 } ) ) ;
591583
584+ const result = await fetchStationsByLineId ( {
585+ variables : { lineId, stationId : lineStationId } ,
586+ } ) ;
587+ const fetchedStations = result . data ?. lineStations ?? [ ] ;
588+
589+ const pendingStation =
590+ fetchedStations . find ( ( s ) => s . id === lineStationId ) ?? null ;
591+
592+ setStationState ( ( prev ) => ( {
593+ ...prev ,
594+ pendingStation,
595+ pendingStations : fetchedStations ,
596+ } ) ) ;
597+
592598 if ( line . station ?. hasTrainTypes ) {
593599 const result = await fetchTrainTypes ( {
594600 variables : {
You can’t perform that action at this time.
0 commit comments