fix: unable to use print mode when loading timetable using 'id' query parameter

This commit is contained in:
2025-04-27 18:00:55 +02:00
parent dc7d0a7ccc
commit f4aa0b28a1
2 changed files with 14 additions and 5 deletions
+11 -4
View File
@@ -123,6 +123,7 @@ import {
} from '@heroicons/vue/16/solid';
import { getRegionNameById } from '../../utils/trainUtils';
import type { TimetableData, ViewMode } from '../../types/common.types';
import { watch } from 'vue';
// Stores
const apiStore = useApiStore();
@@ -137,6 +138,16 @@ const isTimetableSaved = computed(() => {
);
});
// Watchers
watch(
() => globalStore.selectedActiveTrain,
(curr) => {
if (curr != null) {
globalStore.generatedDate = new Date();
}
}
);
// Methods
function selectTrain() {
if (!apiStore.activeData) return;
@@ -144,10 +155,6 @@ function selectTrain() {
globalStore.selectedActiveTrain =
globalStore.activeTimetableTrains.find((train) => train.id == globalStore.selectedTrainId) ??
null;
if (globalStore.selectedActiveTrain != null) {
globalStore.generatedDate = new Date();
}
}
function toggleViewMode(viewMode: ViewMode) {