-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only call stopTimes if we don't already have the data #1308
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonderful work!
lib/actions/apiV2.js
Outdated
if ( | ||
!params.forceFetch && | ||
getState().otp.transitIndex.stops[params.stopId] | ||
) { | ||
return | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we one-line this if eslint lets us? Getting rid of the brackets might help.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Description:
Fixes a bug where interaction with
setViewedRoute
was causing thefindStopTimesForStop
and subsequent response to fire forever. This should only fire when the stop information isn't already there. Also adds aforceFetch
param for the stop schedule viewer, so that if you're trying to look at different schedule days, it will update the info with the new day.PR Checklist: