Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/component/itinerary/StreetModeSelectorButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function StreetModeSelectorButton(
break;
case streetHash.carAndVehicle:
distance = displayDistance(
getTotalDrivingDistance(itinerary),
getTotalDrivingDistance(itinerary, config),
config,
intl.formatNumber,
);
Expand Down
4 changes: 3 additions & 1 deletion app/configurations/config.kela.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ export default {
},
],
},

carBoardingModes: {
FERRY: { showNotification: false },
},
transportModes: {
citybike: {
availableForSelection: false,
Expand Down
6 changes: 5 additions & 1 deletion app/util/legUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,11 @@ export function getTotalBikingDistance(itinerary) {
return sumDistances(itinerary.legs.filter(isBikingLeg));
}

export function getTotalDrivingDistance(itinerary) {
export function getTotalDrivingDistance(itinerary, config = {}) {
// Don't rely only driving legs when calculating the one way journey.
if (config?.emphasizeOneWayJourney) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for ? as you provide default for config

return sumDistances(itinerary.legs);
}
return sumDistances(itinerary.legs.filter(isDrivingLeg));
}

Expand Down
Loading