mirror of
https://github.com/Spythere/srjp-td2.git
synced 2026-05-03 21:48:13 +00:00
fix: unable to use print mode when loading timetable using 'id' query parameter
This commit is contained in:
+3
-1
@@ -53,7 +53,9 @@ function loadStorageTimetables() {
|
||||
|
||||
function setupDarkMode() {
|
||||
globalStore.darkMode =
|
||||
localStorage.currentTheme === 'dark' || (!('currentTheme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches);
|
||||
localStorage.currentTheme === 'dark' ||
|
||||
(!('currentTheme' in localStorage) &&
|
||||
window.matchMedia('(prefers-color-scheme: dark)').matches);
|
||||
}
|
||||
|
||||
function setupAfterPrintClose() {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user