Optymalizacja i cleanup kodu

This commit is contained in:
2021-12-31 16:07:34 +01:00
parent d62b74652e
commit 82f44842ee
9 changed files with 391 additions and 338 deletions
+5 -5
View File
@@ -87,23 +87,23 @@ export const getTrainStopStatus = (stopInfo: TrainStop, timetableData: { current
stopStatus = "terminated";
stopLabel = "Skończył bieg";
stopStatusID = 5;
} else if (!stopInfo.terminatesHere && stopInfo.confirmed && timetableData.currentStationName == station.stationName) {
} else if (!stopInfo.terminatesHere && stopInfo.confirmed && timetableData.currentStationName == station.name) {
stopStatus = "departed";
stopLabel = "Odprawiony";
stopStatusID = 2;
} else if (!stopInfo.terminatesHere && stopInfo.confirmed && timetableData.currentStationName != station.stationName) {
} else if (!stopInfo.terminatesHere && stopInfo.confirmed && timetableData.currentStationName != station.name) {
stopStatus = "departed-away";
stopLabel = "Odjechał";
stopStatusID = 4;
} else if (timetableData.currentStationName == station.stationName && !stopInfo.stopped) {
} else if (timetableData.currentStationName == station.name && !stopInfo.stopped) {
stopStatus = "online";
stopLabel = "Na stacji";
stopStatusID = 0;
} else if (timetableData.currentStationName == station.stationName && stopInfo.stopped) {
} else if (timetableData.currentStationName == station.name && stopInfo.stopped) {
stopStatus = "stopped";
stopLabel = "Postój";
stopStatusID = 1;
} else if (timetableData.currentStationName != station.stationName) {
} else if (timetableData.currentStationName != station.name) {
stopStatus = "arriving";
stopLabel = "W drodze";
stopStatusID = 3;