Poprawki statusów danych

This commit is contained in:
2022-02-09 22:27:07 +01:00
parent 75308f97f8
commit 7066977f23
9 changed files with 30 additions and 13 deletions
+2 -1
View File
@@ -5,6 +5,7 @@ export const getLocoURL = (locoType: string): string => (`https://rj.td2.info.pl
export const getStatusID = (stationStatus: any): string => {
if (!stationStatus) return "not-signed";
if (stationStatus == -1) return "unknown";
const statusCode = stationStatus[2];
const statusTimestamp = stationStatus[3];
@@ -33,7 +34,7 @@ export const getStatusID = (stationStatus: any): string => {
};
export const getStatusTimestamp = (stationStatus: any): number => {
if (!stationStatus) return -2;
if (!stationStatus || stationStatus == -1) return -2;
const statusCode = stationStatus[2];
const statusTimestamp = stationStatus[3];