Skip to content

Commit

Permalink
Merge branch 'dev' into disable-pattern-filtering-removing-all-patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
miles-grant-ibigroup authored Nov 17, 2023
2 parents 1ec6dce + 9349dd4 commit d8d0229
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/actions/apiV2.js
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ export function routingQuery(searchId = null, updateSearchInReducer) {
config?.modes?.initialState?.enabledModeButtons ||
{}

const strictModes = config?.itinerary?.strictItineraryFiltering
const strictModes = !!config?.itinerary?.strictItineraryFiltering

// Filter mode definitions based on active mode keys
const activeModeButtons = config.modes?.modeButtons.filter((mb) =>
Expand Down Expand Up @@ -968,7 +968,7 @@ export function routingQuery(searchId = null, updateSearchInReducer) {
let filteredItineraries = itineraries
// If "strictItineraryFiltering" is enabled, only return itineraries that contain at least one explicitly requested mode...
if (strictModes) {
filteredItineraries = itineraries.filter((itin) =>
filteredItineraries = itineraries?.filter((itin) =>
itin.legs.some((leg) =>
activeModeStrings.includes(SIMPLIFICATIONS[leg.mode])
)
Expand All @@ -977,7 +977,7 @@ export function routingQuery(searchId = null, updateSearchInReducer) {
}

// Filter itineraries to collapse short names and hide unnecessary errors.
const withCollapsedShortNames = filteredItineraries.map(
const withCollapsedShortNames = filteredItineraries?.map(
(itin) => ({
...itin,
legs: itin.legs
Expand Down

0 comments on commit d8d0229

Please sign in to comment.