From a8da634b0e69092778d44a506bba8fc1a95c91f5 Mon Sep 17 00:00:00 2001 From: Spythere Date: Thu, 22 Aug 2024 23:19:42 +0200 Subject: [PATCH] hotfix: TrainsView watcher causing routing problems --- src/router/index.ts | 3 ++- src/views/DriverView.vue | 15 +++++++++++++-- src/views/TrainsView.vue | 23 ++++++----------------- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/src/router/index.ts b/src/router/index.ts index 524bc0b..71acc24 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -25,7 +25,8 @@ const routes: Array = [ name: 'DriverView', component: () => import('../views/DriverView.vue'), props: (route) => ({ - trainId: route.query.trainId + trainId: route.query.trainId, + modalId: route.query.modalId }) }, { diff --git a/src/views/DriverView.vue b/src/views/DriverView.vue index cfe4e04..0afcaa8 100644 --- a/src/views/DriverView.vue +++ b/src/views/DriverView.vue @@ -7,7 +7,10 @@ train icon {{ $t('trains.driver-return-link') }} - + train icon {{ $t('trains.driver-journal-link') }} @@ -50,13 +53,21 @@ import { Status } from '../typings/common'; const props = defineProps({ trainId: { + type: String, required: true + }, + + modalId: { + type: String } }); const mainStore = useMainStore(); const apiStore = useApiStore(); -const chosenTrain = computed(() => mainStore.trainList.find((train) => train.id == props.trainId)); + +const chosenTrain = computed(() => + mainStore.trainList.find((train) => train.id == props.trainId || train.modalId == props.modalId) +);