File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -91,6 +91,7 @@ import NaviContainer from './navigator/NaviContainer';
9191import NaviGeolocationInfoModal from './navigator/navigatorgeolocation/NaviGeolocationInfoModal' ;
9292import NavigatorIntroModal from './navigator/navigatorintro/NavigatorIntroModal' ;
9393import { planConnection } from './queries/PlanConnection' ;
94+ import { hasTaxiLegs } from '../../util/legUtils' ;
9495
9596const MAX_QUERY_COUNT = 4 ; // number of attempts to collect enough itineraries
9697
@@ -1459,7 +1460,10 @@ export default function ItineraryPage(props, context) {
14591460 Date . now ( ) + 24 * 3600 * 1000 ;
14601461
14611462 const navigateHook =
1462- ! desktop && config . navigation && presentSearch
1463+ ! desktop &&
1464+ config . navigation &&
1465+ presentSearch &&
1466+ ! hasTaxiLegs ( combinedEdges [ selectedIndex ] ?. node )
14631467 ? ( ) =>
14641468 startNavigationWithAnalytics ( combinedEdges [ selectedIndex ] ?. node )
14651469 : undefined ;
Original file line number Diff line number Diff line change @@ -108,6 +108,7 @@ export const LegMode = {
108108 Car : 'CAR' ,
109109 Rail : 'RAIL' ,
110110 Wait : 'WAIT' ,
111+ Taxi : 'TAXI' ,
111112} ;
112113
113114/**
@@ -134,6 +135,8 @@ export function getLegMode(legOrMode) {
134135 return LegMode . Car ;
135136 case LegMode . Rail :
136137 return LegMode . Rail ;
138+ case LegMode . Taxi :
139+ return LegMode . Taxi ;
137140 default :
138141 return undefined ;
139142 }
@@ -460,7 +463,14 @@ function isBikingLeg(leg) {
460463 return [ LegMode . Bicycle , LegMode . CityBike ] . includes ( getLegMode ( leg ) ) ;
461464}
462465function isDrivingLeg ( leg ) {
463- return [ LegMode . Car ] . includes ( getLegMode ( leg ) ) ;
466+ return LegMode . Car === getLegMode ( leg ) ;
467+ }
468+ function isTaxiLeg ( leg ) {
469+ return LegMode . Taxi === getLegMode ( leg ) ;
470+ }
471+
472+ export function hasTaxiLegs ( itinerary ) {
473+ return itinerary . legs . some ( isTaxiLeg ) ;
464474}
465475
466476/**
You can’t perform that action at this time.
0 commit comments