diff --git a/src/panels/Fahrplan/FahrplanPanel.tsx b/src/panels/Fahrplan/FahrplanPanel.tsx index fc9b7a177e8b0c5f09dd3e844544c73bc34e809d..e33a20c18e4991dbde5ba62a9335f47a2d018264 100644 --- a/src/panels/Fahrplan/FahrplanPanel.tsx +++ b/src/panels/Fahrplan/FahrplanPanel.tsx @@ -52,6 +52,11 @@ const FahrplanPanel = (props: {definition: FahrplanPanelDefinition}) => { const delay = stringToDelay(departure.delay); const arrival = processArrival(departure.sched_date, departure.time); + // Throw away stops that are five hours in the future as keys start colliding at some point + if(arrival.getTime() >= 5 * 60 * 60 * 1000 + (new Date()).getTime()) { + continue; + } + if(existing_ind === -1) { // If it does not exist, create a new route newRoutes.push({ @@ -69,7 +74,7 @@ const FahrplanPanel = (props: {definition: FahrplanPanelDefinition}) => { countdown: parseInt(departure.countdown) }) } else { - // If it doesn't, just add a stop to the existing route + // If it does, just add a stop to the existing route newRoutes[existing_ind].stops.push({ name: departure.internal.stop, arrival,