From 30abb950cba332b9c33bfb1156833c7b9d17ab0a Mon Sep 17 00:00:00 2001 From: Andreas Helms Date: Wed, 8 Jan 2025 11:12:40 +0100 Subject: [PATCH] fix(itinerary-list): contains non transit entries --- app/component/ItineraryPage.js | 7 ++++++- app/component/StreetModeSelector.js | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/component/ItineraryPage.js b/app/component/ItineraryPage.js index 335530ff2f..3564b66653 100644 --- a/app/component/ItineraryPage.js +++ b/app/component/ItineraryPage.js @@ -313,6 +313,11 @@ class ItineraryPage extends React.Component { ]), }; + const parkRidePlan = { + ...result.parkRidePlan, + itineraries: transitItineraries(result.parkRidePlan.itineraries), + }; + this.setState( { loadingAlt: false, @@ -324,7 +329,7 @@ class ItineraryPage extends React.Component { scooterRentAndPublicPlan: result.scooterRentAndPublicPlan, carPlan: result.carPlan, carRentalPlan: result.carRentalPlan, - parkRidePlan: result.parkRidePlan, + parkRidePlan, onDemandTaxiPlan: result.onDemandTaxiPlan, }, () => { diff --git a/app/component/StreetModeSelector.js b/app/component/StreetModeSelector.js index d89cb0420e..02265e6fa1 100644 --- a/app/component/StreetModeSelector.js +++ b/app/component/StreetModeSelector.js @@ -51,9 +51,10 @@ export const StreetModeSelector = ({ ...(bikeParkPlan?.itineraries || []), ...(bikeAndPublicPlan?.itineraries || []), ...(bikeRentAndPublicPlan?.itineraries || []), - ], + ].filter(itinerary => itinerary.legs.some(l => l.transitLeg)), } : {}; + const carRentalOrOwn = !loading ? { itineraries: [