diff --git a/src/components/StationsView/StationCard.vue b/src/components/StationsView/StationCard.vue index 1beaf8e..da460cb 100644 --- a/src/components/StationsView/StationCard.vue +++ b/src/components/StationsView/StationCard.vue @@ -175,22 +175,27 @@ - Odprawiony + Skończył bieg + + Odprawiony + Na stacji - Postój W drodze - Skończył bieg + Postój diff --git a/src/store/store.ts b/src/store/store.ts index b91291a..28de914 100644 --- a/src/store/store.ts +++ b/src/store/store.ts @@ -97,7 +97,7 @@ export default class Store extends VuexModule { this.context.commit('setJSONData'); this.context.dispatch('fetchOnlineData'); - setInterval(() => this.context.dispatch('fetchOnlineData'), 5000); + setInterval(() => this.context.dispatch('fetchOnlineData'), 20000); } @Action({ commit: 'updateTimetableData' }) @@ -286,11 +286,13 @@ export default class Store extends VuexModule { return acc; }, [] as Station[]); + console.log(this.stationList); + // Dodawanie do listy online potencjalnych scenerii niewpisanych do bazy updatedStationList.forEach(updatedStation => { - const alreadyInList: any = this.stationList.find(station => station.stationName === updatedStation.stationName); + const alreadyInList: any = this.stationList.findIndex(station => station.stationName === updatedStation.stationName); - if (!alreadyInList) { + if (alreadyInList < 0) { this.stationList.push({ ...updatedStation, online: true, diff --git a/src/views/StationsView.vue b/src/views/StationsView.vue index 7492821..5b9d071 100644 --- a/src/views/StationsView.vue +++ b/src/views/StationsView.vue @@ -177,7 +177,7 @@ export default class StationsView extends Vue { if (this.filters["SPK"] && (station.controlType === "SPK" || station.controlType.includes("+SPK"))) return false; - if (this.filters["SCS"] && station.controlType === "SCS" || station.controlType.includes("+SCS")) + if (this.filters["SCS"] && (station.controlType === "SCS" || station.controlType.includes("+SCS"))) return false; if (this.filters["SCS"] && this.filters["SPK"] && (station.controlType.includes("SPK") || station.controlType.includes("SCS"))) @@ -188,6 +188,7 @@ export default class StationsView extends Vue { station.controlType.includes("mechaniczne") ) return false; + if (this.filters["ręczne"] && station.controlType.includes("ręczne")) return false;