From 3d4724e314711298cd72ebe0adfc38695fb1d570 Mon Sep 17 00:00:00 2001 From: roschaefer Date: Fri, 16 Aug 2019 00:19:26 +0200 Subject: [PATCH] Fix `Cannot read property countUser of null` This commit message is a great example of why you should explain **the reason** of your commit. When I came across this bug I had a quick look into the code where it came from. I could see that the bug only happened after a timer and apparently reverting the biggest part of d84892930295dcfd3f6687fc33c7234446127099 would fix the bug. However I have no idea what the following commit message means: ``` commit d84892930295dcfd3f6687fc33c7234446127099 Author: Grzegorz Leoniec Date: Wed Mar 6 18:45:57 2019 +0100 Improved countTo component ``` I just don't know why the code is there - like what is it's purpose @appinteractive? I can only guess: I believe that it's supposed to update the counters in-place (without starting from 0 everytime). Because apollo was set to poll the data every second. Taking that into account I would rather remove this polling feature completely and have less code and less complexity. Admins can still refresh the page. --- webapp/components/CountTo.vue | 20 +------------------- webapp/pages/admin/index.vue | 21 +++++++++------------ 2 files changed, 10 insertions(+), 31 deletions(-) diff --git a/webapp/components/CountTo.vue b/webapp/components/CountTo.vue index ee0e3e082..65ad84b56 100644 --- a/webapp/components/CountTo.vue +++ b/webapp/components/CountTo.vue @@ -2,7 +2,7 @@ { - this.isReady = true - }, 500) - }, } diff --git a/webapp/pages/admin/index.vue b/webapp/pages/admin/index.vue index 7790ed849..39dd4800e 100644 --- a/webapp/pages/admin/index.vue +++ b/webapp/pages/admin/index.vue @@ -7,7 +7,7 @@ - + @@ -16,7 +16,7 @@ - + @@ -30,7 +30,7 @@ uppercase > - + @@ -44,7 +44,7 @@ uppercase > - + @@ -58,7 +58,7 @@ uppercase > - + @@ -72,7 +72,7 @@ uppercase > - + @@ -81,7 +81,7 @@ - + @@ -90,7 +90,7 @@ - + @@ -99,7 +99,7 @@ - + @@ -128,9 +128,6 @@ export default { return process.client }, }, - mounted() { - this.$apollo.queries.statistics.startPolling(5000) - }, apollo: { statistics: { query: gql`