mirror of
https://github.com/Spythere/srjp-td2.git
synced 2026-05-03 13:38:12 +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() {
|
function setupDarkMode() {
|
||||||
globalStore.darkMode =
|
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() {
|
function setupAfterPrintClose() {
|
||||||
|
|||||||
@@ -123,6 +123,7 @@ import {
|
|||||||
} from '@heroicons/vue/16/solid';
|
} from '@heroicons/vue/16/solid';
|
||||||
import { getRegionNameById } from '../../utils/trainUtils';
|
import { getRegionNameById } from '../../utils/trainUtils';
|
||||||
import type { TimetableData, ViewMode } from '../../types/common.types';
|
import type { TimetableData, ViewMode } from '../../types/common.types';
|
||||||
|
import { watch } from 'vue';
|
||||||
|
|
||||||
// Stores
|
// Stores
|
||||||
const apiStore = useApiStore();
|
const apiStore = useApiStore();
|
||||||
@@ -137,6 +138,16 @@ const isTimetableSaved = computed(() => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Watchers
|
||||||
|
watch(
|
||||||
|
() => globalStore.selectedActiveTrain,
|
||||||
|
(curr) => {
|
||||||
|
if (curr != null) {
|
||||||
|
globalStore.generatedDate = new Date();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
function selectTrain() {
|
function selectTrain() {
|
||||||
if (!apiStore.activeData) return;
|
if (!apiStore.activeData) return;
|
||||||
@@ -144,10 +155,6 @@ function selectTrain() {
|
|||||||
globalStore.selectedActiveTrain =
|
globalStore.selectedActiveTrain =
|
||||||
globalStore.activeTimetableTrains.find((train) => train.id == globalStore.selectedTrainId) ??
|
globalStore.activeTimetableTrains.find((train) => train.id == globalStore.selectedTrainId) ??
|
||||||
null;
|
null;
|
||||||
|
|
||||||
if (globalStore.selectedActiveTrain != null) {
|
|
||||||
globalStore.generatedDate = new Date();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleViewMode(viewMode: ViewMode) {
|
function toggleViewMode(viewMode: ViewMode) {
|
||||||
|
|||||||
Reference in New Issue
Block a user