diff --git a/src/components/SceneryView/SceneryDispatchersHistory.vue b/src/components/SceneryView/SceneryDispatchersHistory.vue index b518812..09cf645 100644 --- a/src/components/SceneryView/SceneryDispatchersHistory.vue +++ b/src/components/SceneryView/SceneryDispatchersHistory.vue @@ -96,6 +96,7 @@ export default defineComponent({ data() { return { historyList: [] as API.DispatcherHistory.Response, + lastStationName: '', dataStatus: Status.Data.Loading, DataStatus: Status.Data, apiStore: useApiStore() @@ -103,10 +104,10 @@ export default defineComponent({ }, async activated() { - // if (this.historyList.length == 0) { + this.historyList.length = 0; + const fetchedHistory = await this.fetchAPIData(); if (fetchedHistory) this.historyList = fetchedHistory; - // } }, methods: { @@ -194,7 +195,7 @@ export default defineComponent({ color: springgreen; } -@include responsive.smallScreen{ +@include responsive.smallScreen { .journal-list > div { flex-direction: column; justify-content: center; diff --git a/src/components/SceneryView/SceneryTimetablesHistory.vue b/src/components/SceneryView/SceneryTimetablesHistory.vue index 0ed7ea8..ce3d5e2 100644 --- a/src/components/SceneryView/SceneryTimetablesHistory.vue +++ b/src/components/SceneryView/SceneryTimetablesHistory.vue @@ -136,12 +136,14 @@ export default defineComponent({ }, async activated() { + this.checkedHistoryMode = 'via'; this.fetchAPIData(); }, methods: { async fetchAPIData() { const stationName = this.$route.query['station']; + this.dataStatus = Status.Data.Loading; if (!stationName) { this.historyList = []; @@ -165,12 +167,12 @@ export default defineComponent({ this.dataStatus = Status.Data.Loaded; } catch (error) { console.error(error); + this.dataStatus = Status.Data.Error; } }, checkHistoryMode(mode: HistoryMode) { this.checkedHistoryMode = mode; - this.dataStatus = Status.Data.Loading; this.fetchAPIData(); },