From 976eec9720418155950cb41414f5748c6a153519 Mon Sep 17 00:00:00 2001 From: Henrik Sundell Date: Sun, 28 Sep 2025 12:08:31 +0300 Subject: [PATCH 1/2] Display short transfers clearer --- app/component/itinerary/Legs.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/component/itinerary/Legs.js b/app/component/itinerary/Legs.js index be6705a97d..4ca93134b1 100644 --- a/app/component/itinerary/Legs.js +++ b/app/component/itinerary/Legs.js @@ -145,6 +145,11 @@ export default class Legs extends React.Component { previousLeg?.mode === 'BICYCLE' && previousLeg.to.vehicleParking; const carPark = previousLeg?.mode === 'CAR' && previousLeg.to.vehicleParking; + const isSameStopTransfer = + leg?.to?.stop?.gtfsId !== null && + nextLeg?.from?.stop?.gtfsId !== null && + leg?.to?.stop?.gtfsId === nextLeg?.from?.stop?.gtfsId && + leg?.transitLeg === nextLeg?.transitLeg; const legProps = { leg, index: j, @@ -166,7 +171,7 @@ export default class Legs extends React.Component { const waitThresholdInMs = waitThreshold * 1000; const waitTime = legTime(nextLeg.start) - legTime(leg.end); if ( - waitTime > waitThresholdInMs && + (waitTime > waitThresholdInMs || isSameStopTransfer) && (nextLeg != null ? nextLeg.mode : null) !== 'AIRPLANE' && leg.mode !== 'AIRPLANE' && !nextLeg.intermediatePlace && From dd6a0540eb6fbb479b12faddfafd687c3625b9fb Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Tue, 4 Nov 2025 14:23:44 +0200 Subject: [PATCH 2/2] chore: refactor Legs.js a bit --- app/component/itinerary/Legs.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/component/itinerary/Legs.js b/app/component/itinerary/Legs.js index 4ca93134b1..4c40aea640 100644 --- a/app/component/itinerary/Legs.js +++ b/app/component/itinerary/Legs.js @@ -146,10 +146,9 @@ export default class Legs extends React.Component { const carPark = previousLeg?.mode === 'CAR' && previousLeg.to.vehicleParking; const isSameStopTransfer = - leg?.to?.stop?.gtfsId !== null && - nextLeg?.from?.stop?.gtfsId !== null && - leg?.to?.stop?.gtfsId === nextLeg?.from?.stop?.gtfsId && - leg?.transitLeg === nextLeg?.transitLeg; + leg.transitLeg && + nextLeg?.transitLeg && + leg.to.stop.gtfsId === nextLeg.from.stop.gtfsId; const legProps = { leg, index: j, @@ -172,14 +171,14 @@ export default class Legs extends React.Component { const waitTime = legTime(nextLeg.start) - legTime(leg.end); if ( (waitTime > waitThresholdInMs || isSameStopTransfer) && - (nextLeg != null ? nextLeg.mode : null) !== 'AIRPLANE' && + 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; }