diff --git a/app/component/itinerary/Legs.js b/app/component/itinerary/Legs.js index be6705a97d..4c40aea640 100644 --- a/app/component/itinerary/Legs.js +++ b/app/component/itinerary/Legs.js @@ -145,6 +145,10 @@ export default class Legs extends React.Component { previousLeg?.mode === 'BICYCLE' && previousLeg.to.vehicleParking; const carPark = previousLeg?.mode === 'CAR' && previousLeg.to.vehicleParking; + const isSameStopTransfer = + leg.transitLeg && + nextLeg?.transitLeg && + leg.to.stop.gtfsId === nextLeg.from.stop.gtfsId; const legProps = { leg, index: j, @@ -166,15 +170,15 @@ export default class Legs extends React.Component { const waitThresholdInMs = waitThreshold * 1000; const waitTime = legTime(nextLeg.start) - legTime(leg.end); if ( - waitTime > waitThresholdInMs && - (nextLeg != null ? nextLeg.mode : null) !== 'AIRPLANE' && + (waitTime > waitThresholdInMs || isSameStopTransfer) && + nextLeg.mode !== 'AIRPLANE' && leg.mode !== 'AIRPLANE' && !nextLeg.intermediatePlace && !isNextLegInterlining && leg.to.stop ) { const waitLegProps = { ...leg }; - if (nextLeg && nextLeg.isViaPoint) { + if (nextLeg.isViaPoint) { waitLegProps.isViaPoint = true; nextLeg.isViaPoint = false; }