Skip to content

Commit 5607a04

Browse files
authored
Merge pull request #5014 from HSLdevcom/DT-6293
DT-6293 Itinerary notifier removes intermediate stop list
2 parents cafa80d + 97e5db6 commit 5607a04

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

app/component/itinerary/TransitLeg.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,13 @@ class TransitLeg extends React.Component {
6666
constructor(props) {
6767
super(props);
6868
this.state = {
69-
showIntermediateStops: props.leg.intermediatePlaces.length < 2,
69+
showIntermediateStops:
70+
props.interliningLegs.length >= 1
71+
? props.interliningLegs.reduce(
72+
(sum, leg) => sum + leg.intermediatePlaces.length,
73+
0,
74+
) < 2
75+
: props.leg.intermediatePlaces.length < 2,
7076
showAlternativeLegs: false,
7177
};
7278
}
@@ -143,7 +149,7 @@ class TransitLeg extends React.Component {
143149
renderIntermediate() {
144150
const { leg, mode, interliningLegs } = this.props;
145151
if (
146-
leg.intermediatePlaces.length > 0 &&
152+
(leg.intermediatePlaces.length > 0 || interliningLegs.length > 0) &&
147153
this.state.showIntermediateStops === true
148154
) {
149155
const places = leg.intermediatePlaces.slice();
@@ -419,7 +425,7 @@ class TransitLeg extends React.Component {
419425
color={leg.route ? `#${leg.route.color}` : 'currentColor'}
420426
renderBottomMarker={
421427
!this.state.showIntermediateStops ||
422-
leg.intermediatePlaces.length === 0
428+
(leg.intermediatePlaces.length === 0 && interliningLegs.length < 1)
423429
}
424430
/>
425431
<div
@@ -570,7 +576,8 @@ class TransitLeg extends React.Component {
570576
<LegAgencyInfo leg={leg} />
571577
{intermediateStopCount !== 0 && (
572578
<div className="intermediate-stops-button-container">
573-
{leg.intermediatePlaces.length > 1 && (
579+
{(leg.intermediatePlaces.length > 1 ||
580+
interliningLegs.length >= 1) && (
574581
<StopInfo
575582
toggleFunction={this.toggleShowIntermediateStops}
576583
leg={leg}

0 commit comments

Comments
 (0)