hotfix: twr detection

This commit is contained in:
2025-05-12 21:18:50 +02:00
parent 7ab16960ca
commit ebdffc6241
5 changed files with 7 additions and 10 deletions
+2 -2
View File
@@ -9,7 +9,7 @@
<span <span
class="train-badge twr" class="train-badge twr"
v-if="train.timetableData?.TWR" v-if="train.timetableData?.twr"
data-tooltip-type="BaseTooltip" data-tooltip-type="BaseTooltip"
:data-tooltip-content="$t('warnings.TWR')" :data-tooltip-content="$t('warnings.TWR')"
> >
@@ -156,7 +156,7 @@
v-if="extended && train.timetableData && train.timetableData.warningNotes" v-if="extended && train.timetableData && train.timetableData.warningNotes"
> >
<div class="dangers-badges"> <div class="dangers-badges">
<div v-if="train.timetableData?.TWR"> <div v-if="train.timetableData?.twr">
<div class="train-badge twr">TWR</div> <div class="train-badge twr">TWR</div>
- {{ $t('warnings.TWR') }} - {{ $t('warnings.TWR') }}
</div> </div>
+2 -2
View File
@@ -43,7 +43,7 @@ function filterTrainList(
return train.timetableData?.followingStops.some((stop) => stop.comments); return train.timetableData?.followingStops.some((stop) => stop.comments);
case TrainFilterId.twr: case TrainFilterId.twr:
return !train.timetableData?.TWR; return !train.timetableData?.twr;
case TrainFilterId.pn: case TrainFilterId.pn:
return !train.timetableData?.hasExtraDeliveries; return !train.timetableData?.hasExtraDeliveries;
@@ -52,7 +52,7 @@ function filterTrainList(
return !train.timetableData?.hasDangerousCargo; return !train.timetableData?.hasDangerousCargo;
case TrainFilterId.common: case TrainFilterId.common:
return train.timetableData?.SKR || train.timetableData?.TWR; return train.timetableData?.twr;
case TrainFilterId.passenger: case TrainFilterId.passenger:
return !/^[AMRE]\D{2}$/.test(train.timetableData?.category || ''); return !/^[AMRE]\D{2}$/.test(train.timetableData?.category || '');
+1 -2
View File
@@ -97,8 +97,7 @@ export const useMainStore = defineStore('mainStore', {
followingStops: timetable.stopList, followingStops: timetable.stopList,
routeDistance: timetable.stopList[timetable.stopList.length - 1].stopDistance, routeDistance: timetable.stopList[timetable.stopList.length - 1].stopDistance,
sceneries: timetable.sceneries, sceneries: timetable.sceneries,
TWR: timetable.TWR, twr: timetable.twr,
SKR: timetable.SKR,
warningNotes: timetable.warningNotes, warningNotes: timetable.warningNotes,
hasDangerousCargo: timetable.hasDangerousCargo, hasDangerousCargo: timetable.hasDangerousCargo,
hasExtraDeliveries: timetable.hasExtraDeliveries, hasExtraDeliveries: timetable.hasExtraDeliveries,
+1 -2
View File
@@ -197,8 +197,7 @@ export namespace API {
category: string; category: string;
route: string; route: string;
stopList: TimetableStop[]; stopList: TimetableStop[];
TWR: boolean; twr: boolean;
SKR: boolean;
hasDangerousCargo: boolean; hasDangerousCargo: boolean;
hasExtraDeliveries: boolean; hasExtraDeliveries: boolean;
warningNotes: string | null; warningNotes: string | null;
+1 -2
View File
@@ -83,8 +83,7 @@ export interface TrainTimetableData {
category: string; category: string;
route: string; route: string;
followingStops: TrainStop[]; followingStops: TrainStop[];
TWR: boolean; twr: boolean;
SKR: boolean;
hasDangerousCargo: boolean; hasDangerousCargo: boolean;
hasExtraDeliveries: boolean; hasExtraDeliveries: boolean;
warningNotes: string | null; warningNotes: string | null;