-
Notifications
You must be signed in to change notification settings - Fork 137
DT-6929 Configurable replacement busses #5417
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
Conversation
(route && getRouteMode(route, config)?.includes('replacement')) || | ||
config.replacementBusRoutes?.includes(route?.gtfsId); | ||
const isReplacementTrip = |
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.
Maybe this logic is clearer:
(route &&
(
getRouteMode(route, config).includes('replacement') ||
config.replacementBusRoutes?.includes(route.gtfsId)
)
);
- tests route existence only once
- getRouteMode always returns a value, no need for ?
app/util/modeUtils.js
Outdated
@@ -115,6 +115,9 @@ export function getTransportModes(config) { | |||
} | |||
|
|||
export function getRouteMode(route, config) { | |||
if (config?.replacementBusRoutes?.includes(route?.gtfsId)) { |
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.
This code assumes route is defined. no need for ?
@@ -233,16 +234,22 @@ function ItineraryDetails( | |||
route?.desc?.length |
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.
no need for ? after route
const key = `replacementBusNotification-${ | ||
route?.gtfsId || trip?.gtfsId | ||
}`; | ||
if (!disclaimers.some(d => d?.props?.text === notificationText)) { |
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.
no ned for ? after d.
Proposed Changes
Pull Request Check List
Review