Skip to content

Commit b221f8f

Browse files
Merge pull request #1357 from opentripplanner/dedupe-using-stoptime-headsign
take stoptime headsign into account when filtering nearby stop times
2 parents f93e829 + 3e0bf7c commit b221f8f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: lib/components/viewers/nearby/stop.tsx

+6
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ export const patternArrayforStops = (
4242
p.pattern.route?.shortName === cur.pattern.route?.shortName
4343
} else if (p.pattern.route?.longName && cur.pattern.route?.longName) {
4444
sameRoute = p.pattern.route?.longName === cur.pattern.route?.longName
45+
} else if (
46+
p?.stoptimes?.[0]?.headsign &&
47+
cur?.stoptimes?.[0]?.headsign
48+
) {
49+
sameRoute =
50+
p?.stoptimes?.[0]?.headsign === cur?.stoptimes?.[0]?.headsign
4551
}
4652
return (
4753
extractHeadsignFromPattern(p.pattern) === currentHeadsign && sameRoute

0 commit comments

Comments
 (0)