Skip to content

Commit

Permalink
fixed tag and note filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
ahjyrkia committed Oct 2, 2023
1 parent f955569 commit 9c92c6d
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions src/components/timetable/timetableContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ function combineConsecutiveDays(daysObject) {
const { note, ...rest } = departure;
return rest;
}
if (departure.note && departure.note.includes('pe')) {
return {
...departure,
note: departure.note.replace('pe', '').trim(),
};
}
return departure;
});

Expand Down Expand Up @@ -324,17 +330,6 @@ const propsMapper = mapProps(props => {
duplicateRoutes.push(direction.routeId);
}),
);

departures.forEach(departure => {
if (departure.note && !specialSymbols.includes(departure.note)) {
specialSymbols.push(departure.note);
}
});

if (departures.some(departure => departure.routeId.includes('H'))) {
specialSymbols.push('H');
}

departures = departures.map(departure => ({
...departure,
note: modifyNote(
Expand Down Expand Up @@ -378,6 +373,17 @@ const propsMapper = mapProps(props => {
sundays,
});

const combinedDepartures = [].concat(...Object.values(combinedDays));
combinedDepartures.forEach(departure => {
if (departure.note && !specialSymbols.includes(departure.note)) {
specialSymbols.push(departure.note);
}
});

if (combinedDepartures.some(departure => departure.routeId.includes('H'))) {
specialSymbols.push('H');
}

return {
weekdays,
saturdays,
Expand Down

0 comments on commit 9c92c6d

Please sign in to comment.