From faed36c41c952bc00969d43f8029f95205680907 Mon Sep 17 00:00:00 2001 From: Spythere Date: Sun, 10 Jul 2022 17:14:30 +0200 Subject: [PATCH] =?UTF-8?q?Aktualizacja=20filtrowania=20postoj=C3=B3w?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/scripts/utils/storeUtils.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/scripts/utils/storeUtils.ts b/src/scripts/utils/storeUtils.ts index e65ff3b..faa67c8 100644 --- a/src/scripts/utils/storeUtils.ts +++ b/src/scripts/utils/storeUtils.ts @@ -117,15 +117,16 @@ export function getScheduledTrain(train: Train, trainStopIndex: number, stationN let prevStationName = '', nextStationName = ''; + for (let i = trainStopIndex - 1; i >= 0; i--) { - if (followingStops[i].stopName.startsWith('')) { + if (/strong|podg/g.test(followingStops[i].stopName)) { prevStationName = followingStops[i].stopNameRAW; break; } } for (let i = trainStopIndex + 1; i < followingStops.length; i++) { - if (followingStops[i].stopName.startsWith('')) { + if (/strong|podg/g.test(followingStops[i].stopName)) { nextStationName = followingStops[i].stopNameRAW; break; } @@ -139,7 +140,7 @@ export function getScheduledTrain(train: Train, trainStopIndex: number, stationN if (currentStop.departureLine == null) break; - if (!/-|_|it|sbl/gi.test(currentStop.departureLine)) { + if (!/_|it|sbl/gi.test(currentStop.departureLine)) { departureLine = currentStop.departureLine; break; } @@ -150,7 +151,7 @@ export function getScheduledTrain(train: Train, trainStopIndex: number, stationN if (currentStop.arrivalLine == null) break; - if (!/-|_|it|sbl/gi.test(currentStop.arrivalLine)) { + if (!/_|it|sbl/gi.test(currentStop.arrivalLine)) { arrivingLine = currentStop.arrivalLine; break; }