Skip to content

Commit

Permalink
Partial departure fix continues
Browse files Browse the repository at this point in the history
  • Loading branch information
e-halinen committed Sep 4, 2024
1 parent dc8330c commit 8739a66
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/lineTimetable/lineTimetable.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ const RouteDepartures = props => {
}
return stop;
});
return remappedStopDepartures;
return Object.values(
omit(remappedStopDepartures, ['combinedDays.saturdays', 'combinedDays.sundays']), // Remove redundant departure arrays
);
}
// 'saturdays' and 'sundays' departures separately
if (isEqual(firstStopDayKeys, [scheduleSegments.saturdays, scheduleSegments.sundays])) {
Expand All @@ -115,7 +117,7 @@ const RouteDepartures = props => {
}
return stop;
});
return remappedStopDepartures;
return Object.values(omit(remappedStopDepartures, ['combinedDays.saturdays-sundays'])); // Remove redundant departure array
}
}

Expand Down Expand Up @@ -149,7 +151,6 @@ const RouteDepartures = props => {
});

const sanityCheckedDepartures = fixPartialWeekendDepartures(mappedDepartures);
console.log(sanityCheckedDepartures);
const mergedWeekdaysDepartures = sanityCheckedDepartures.map(mappedDeparturesForStop => {
if (
mappedDeparturesForStop.combinedDays[scheduleSegments.fridays] &&
Expand Down

0 comments on commit 8739a66

Please sign in to comment.