From ee2b5ddc073c525a375037fc268001f82b13ee1b Mon Sep 17 00:00:00 2001 From: Spythere Date: Sat, 4 Jul 2020 22:32:15 +0200 Subject: [PATCH] =?UTF-8?q?Dodano=20dynamiczne=20od=C5=9Bwie=C5=BCanie=20t?= =?UTF-8?q?abeli?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- firebase.json | 5 +++-- src/App.vue | 19 ++++++++++++------- src/components/ui/List.vue | 2 -- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/firebase.json b/firebase.json index e782939..1a2dbd6 100644 --- a/firebase.json +++ b/firebase.json @@ -1,10 +1,11 @@ { "hosting": { - "public": "public", + "public": "dist", + "site": "stacjownik-td2", "ignore": [ "firebase.json", "**/.*", "**/node_modules/**" ] } -} +} \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index 3d1a1d7..66378f8 100644 --- a/src/App.vue +++ b/src/App.vue @@ -41,7 +41,15 @@ export default Vue.extend({ }), methods: { - ...mapActions(["fetchStations"]) + ...mapActions(["fetchStations"]), + getStationList() { + this.fetchStations() + .then(() => (this.connectionState = 2)) + .catch(err => { + this.connectionState = 1; + this.errorMessage = err.message; + }); + } }, data: () => ({ errorMessage: "", @@ -49,12 +57,9 @@ export default Vue.extend({ }), mounted() { - this.fetchStations() - .then(() => (this.connectionState = 2)) - .catch(err => { - this.connectionState = 1; - this.errorMessage = err.message; - }); + this.getStationList(); + + setInterval(this.getStationList, 5000); } }); diff --git a/src/components/ui/List.vue b/src/components/ui/List.vue index 8b0c33b..f05f30b 100644 --- a/src/components/ui/List.vue +++ b/src/components/ui/List.vue @@ -122,8 +122,6 @@ export default Vue.extend({ ); }, focusedStationInfo() { - console.log(this.focusedStationName); - return this.stations.find( (station: any) => station.stationName === this.focusedStationName );