From 235f3fd0b57061ef869cf3ceaebb7b449fcbb7cd Mon Sep 17 00:00:00 2001 From: Timo Volkmann Date: Fri, 10 May 2019 11:30:39 +0200 Subject: [PATCH] small bugfix --- frontend/src/pages/MyCaches.vue | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/frontend/src/pages/MyCaches.vue b/frontend/src/pages/MyCaches.vue index 1dab5cd..aa27a91 100644 --- a/frontend/src/pages/MyCaches.vue +++ b/frontend/src/pages/MyCaches.vue @@ -105,8 +105,6 @@ return { tab: 'startedCaches', startedCaches: [], - - //progress: 0.4 } }, mounted: function () { @@ -118,30 +116,21 @@ }, created: function () { this.$store.commit('auth/SET_AUTHENTICATED'); - //this.$store.commit('auth/SET_USER'); this.fetchUserCaches(); - }, methods: { calculateProgress() { console.log("calcProgress...") console.log("this.startedCaches: ") console.log(this.startedCaches) - // for (let startedCache of this.startedCaches) { - // console.log(startedCache) - // let stationCount = startedCache.cache.stationen.length; - // let stationPos = 1 + startedCache.cache.stationen.findIndex(station => station.id === startedCache.aktuelleStation.id); - // startedCache.progress = stationPos / stationCount; - // console.log(startedCache.progress) - // } this.startedCaches.forEach(startedCache => { console.log(startedCache) let stationCount = startedCache.cache.stationen.length; let stationPos = 1 + startedCache.cache.stationen.findIndex(station => station.id === startedCache.aktuelleStation.id); startedCache.progress = stationPos / stationCount; - console.log(startedCache.progress) - }) - console.log("calcProgress finished.") + console.log("progress: "+startedCache.progress) + }); + console.log("calcProgress finished."); console.log(this.startedCaches) }, fetchUserCaches() { @@ -156,7 +145,7 @@ .then((response) => { console.log(response.data) this.startedCaches = response.data; - + this.calculateProgress(); }).catch((error) => { // Error let msg; @@ -180,9 +169,7 @@ this.$store.commit('dialog/NEW_MESSAGE_DIALOG', {message: msg, title: title,}); }).finally(() => { console.log("fetchCaches... finally") - this.calculateProgress(); }); - console.log("fetchCaches... outside") }, continueCache(cacheID) { console.log("cacheID");