From ebdffc62418a3803bbe07ffcc68c481f09f00c9e Mon Sep 17 00:00:00 2001 From: Spythere Date: Mon, 12 May 2025 21:18:50 +0200 Subject: [PATCH] hotfix: twr detection --- src/components/TrainsView/TrainInfo.vue | 4 ++-- src/managers/trainFilterManager.ts | 4 ++-- src/store/mainStore.ts | 3 +-- src/typings/api.ts | 3 +-- src/typings/common.ts | 3 +-- 5 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/components/TrainsView/TrainInfo.vue b/src/components/TrainsView/TrainInfo.vue index c18ac77..35dc15b 100644 --- a/src/components/TrainsView/TrainInfo.vue +++ b/src/components/TrainsView/TrainInfo.vue @@ -9,7 +9,7 @@ @@ -156,7 +156,7 @@ v-if="extended && train.timetableData && train.timetableData.warningNotes" >
-
+
TWR
- {{ $t('warnings.TWR') }}
diff --git a/src/managers/trainFilterManager.ts b/src/managers/trainFilterManager.ts index 46c1c19..8ce366b 100644 --- a/src/managers/trainFilterManager.ts +++ b/src/managers/trainFilterManager.ts @@ -43,7 +43,7 @@ function filterTrainList( return train.timetableData?.followingStops.some((stop) => stop.comments); case TrainFilterId.twr: - return !train.timetableData?.TWR; + return !train.timetableData?.twr; case TrainFilterId.pn: return !train.timetableData?.hasExtraDeliveries; @@ -52,7 +52,7 @@ function filterTrainList( return !train.timetableData?.hasDangerousCargo; case TrainFilterId.common: - return train.timetableData?.SKR || train.timetableData?.TWR; + return train.timetableData?.twr; case TrainFilterId.passenger: return !/^[AMRE]\D{2}$/.test(train.timetableData?.category || ''); diff --git a/src/store/mainStore.ts b/src/store/mainStore.ts index 9e57de9..ad6e49c 100644 --- a/src/store/mainStore.ts +++ b/src/store/mainStore.ts @@ -97,8 +97,7 @@ export const useMainStore = defineStore('mainStore', { followingStops: timetable.stopList, routeDistance: timetable.stopList[timetable.stopList.length - 1].stopDistance, sceneries: timetable.sceneries, - TWR: timetable.TWR, - SKR: timetable.SKR, + twr: timetable.twr, warningNotes: timetable.warningNotes, hasDangerousCargo: timetable.hasDangerousCargo, hasExtraDeliveries: timetable.hasExtraDeliveries, diff --git a/src/typings/api.ts b/src/typings/api.ts index aa563fc..7e49c6d 100644 --- a/src/typings/api.ts +++ b/src/typings/api.ts @@ -197,8 +197,7 @@ export namespace API { category: string; route: string; stopList: TimetableStop[]; - TWR: boolean; - SKR: boolean; + twr: boolean; hasDangerousCargo: boolean; hasExtraDeliveries: boolean; warningNotes: string | null; diff --git a/src/typings/common.ts b/src/typings/common.ts index 850ab28..e2004fa 100644 --- a/src/typings/common.ts +++ b/src/typings/common.ts @@ -83,8 +83,7 @@ export interface TrainTimetableData { category: string; route: string; followingStops: TrainStop[]; - TWR: boolean; - SKR: boolean; + twr: boolean; hasDangerousCargo: boolean; hasExtraDeliveries: boolean; warningNotes: string | null;