Skip to content

Commit

Permalink
Fix clicking on trip on multi stops
Browse files Browse the repository at this point in the history
  • Loading branch information
consindo committed Jan 4, 2021
1 parent 0bf28e1 commit 8285720
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
10 changes: 9 additions & 1 deletion js/views/station/InactiveTrips.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export const InactiveTrips = ({ routes, onClick, region }) => {
direction_id: directionId,
route_color: routeColor,
route_text_color: routeTextColor,
stop_id: stopId,
} = route
return (
<TripItem
Expand All @@ -79,7 +80,14 @@ export const InactiveTrips = ({ routes, onClick, region }) => {
},
]}
onClick={() =>
onClick(agencyId, routeId, routeShortName, directionId)
onClick(
agencyId,
routeId,
routeShortName,
directionId,
null,
stopId
)
}
/>
)
Expand Down
8 changes: 5 additions & 3 deletions js/views/station/Station.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,11 @@ class Station extends Component {
routeId,
routeShortName,
directionId,
tripId = null
tripId = null,
stopId
) => {
const { history, match } = this.props
const url = ['/l', match.params.region, agencyId, routeShortName].join('/')
const stopId = match.params.station
let tripIdParameter = ''
if (tripId != null) {
tripIdParameter = `&trip_id=${tripId}`
Expand Down Expand Up @@ -273,6 +273,7 @@ class Station extends Component {
route_id: routeId,
route_text_color: routeTextColor,
route_icon: routeIcon,
stop_id: stopId,
} = item[0]
return (
<TripItem
Expand All @@ -296,7 +297,8 @@ class Station extends Component {
routeId,
routeShortName,
directionId,
tripId
tripId,
stopId
)
}
/>
Expand Down

0 comments on commit 8285720

Please sign in to comment.