hotfix: timetables for unknown sceneries

This commit is contained in:
2024-06-10 20:18:09 +02:00
parent fc7662e431
commit ebfb24f729
@@ -213,7 +213,10 @@ export default defineComponent({
const mainStore = useMainStore(); const mainStore = useMainStore();
const chosenCheckpoint = ref( const chosenCheckpoint = ref(
props.station?.generalInfo?.checkpoints[0] ?? props.station?.name ?? '' props.station?.generalInfo?.checkpoints[0] ??
props.station?.name ??
route.query['station']?.toString() ??
''
); );
return { return {
@@ -233,9 +236,10 @@ export default defineComponent({
}, },
sceneryTimetables(): SceneryTimetableRow[] { sceneryTimetables(): SceneryTimetableRow[] {
if (!this.station) return [];
if (!this.onlineScenery) return []; if (!this.onlineScenery) return [];
const sceneryName = this.$route.query['station']?.toString() ?? '';
return this.onlineScenery.scheduledTrains return this.onlineScenery.scheduledTrains
.filter( .filter(
(ct) => (ct) =>
@@ -247,7 +251,7 @@ export default defineComponent({
const trainStopStatus = getTrainStopStatus( const trainStopStatus = getTrainStopStatus(
ct.checkpointStop, ct.checkpointStop,
ct.train.currentStationName, ct.train.currentStationName,
this.station!.name sceneryName
); );
const trainStopIndex = const trainStopIndex =