From 04c48c7a701ba6d49e072c4444d0b09e8436e6a6 Mon Sep 17 00:00:00 2001 From: Spythere Date: Tue, 3 May 2022 12:48:36 +0200 Subject: [PATCH] Poprawki w error handlingu --- src/components/StationsView/StationTable.vue | 2 +- src/components/TrainsView/TrainTable.vue | 2 +- src/store/index.ts | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/StationsView/StationTable.vue b/src/components/StationsView/StationTable.vue index 247c85b..63f042b 100644 --- a/src/components/StationsView/StationTable.vue +++ b/src/components/StationsView/StationTable.vue @@ -287,7 +287,7 @@ export default defineComponent({ const data: ComputedRef = computed(() => store.getters[GETTERS.allData]); const isDataLoaded = computed(() => { - return data.value.sceneryDataStatus == DataStatus.Loaded; + return data.value.sceneryDataStatus != DataStatus.Loading; }); return { diff --git a/src/components/TrainsView/TrainTable.vue b/src/components/TrainsView/TrainTable.vue index a66cf3b..ee3ba3f 100644 --- a/src/components/TrainsView/TrainTable.vue +++ b/src/components/TrainsView/TrainTable.vue @@ -6,7 +6,7 @@ {{ $t('trains.distance-exceeded') }} --> -
+
{{ $t('trains.no-trains') }}
diff --git a/src/store/index.ts b/src/store/index.ts index 3141aaf..a82a88e 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -101,6 +101,9 @@ export const store = createStore({ async fetchOnlineData({ commit }, data: APIData) { if (!data.stations) { commit(MUTATIONS.SET_SCENERY_DATA_STATUS, DataStatus.Error); + commit(MUTATIONS.SET_TRAINS_DATA_STATUS, DataStatus.Error); + commit(MUTATIONS.SET_DISPATCHER_DATA_STATUS, DataStatus.Error); + return; }