mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 05:18:11 +00:00
SRJP: naprawiono wyświetlanie się szlaków w przypadku SBL
This commit is contained in:
+18
-2
@@ -184,8 +184,19 @@ export const store = createStore<State>({
|
||||
|
||||
if (!timetable || !trainInfo) return acc;
|
||||
|
||||
let lastArrivalLine = "";
|
||||
|
||||
const followingStops: TrainStop[] = timetable.stopPoints.reduce((stopsAcc: TrainStop[], point) => {
|
||||
if (point.pointNameRAW.toLowerCase().includes("sbl")) return stopsAcc;
|
||||
if (point.pointNameRAW.toLowerCase().includes("sbl")) {
|
||||
if (point.arrivalLine && !point.arrivalLine.toLocaleLowerCase().includes("sbl"))
|
||||
lastArrivalLine = point.arrivalLine;
|
||||
|
||||
if (point.departureLine && !point.departureLine.toLocaleLowerCase().includes("sbl")) {
|
||||
stopsAcc[stopsAcc.length - 1].departureLine = point.departureLine
|
||||
}
|
||||
|
||||
return stopsAcc;
|
||||
}
|
||||
|
||||
const arrivalTimestamp = getTimestamp(point.arrivalTime);
|
||||
const arrivalRealTimestamp = getTimestamp(point.arrivalRealTime);
|
||||
@@ -193,6 +204,11 @@ export const store = createStore<State>({
|
||||
const departureTimestamp = getTimestamp(point.departureTime);
|
||||
const departureRealTimestamp = getTimestamp(point.departureRealTime);
|
||||
|
||||
let arrivalLine = lastArrivalLine || point.arrivalLine;
|
||||
|
||||
if (lastArrivalLine != "")
|
||||
lastArrivalLine = "";
|
||||
|
||||
stopsAcc.push({
|
||||
stopName: point.pointName,
|
||||
stopNameRAW: point.pointNameRAW,
|
||||
@@ -201,7 +217,7 @@ export const store = createStore<State>({
|
||||
|
||||
mainStop: point.pointName.includes("strong"),
|
||||
|
||||
arrivalLine: point.arrivalLine,
|
||||
arrivalLine,
|
||||
arrivalTimeString: timestampToString(arrivalTimestamp),
|
||||
arrivalTimestamp: arrivalTimestamp,
|
||||
arrivalRealTimeString: timestampToString(arrivalRealTimestamp),
|
||||
|
||||
Reference in New Issue
Block a user