Merge pull request #1277 from Human-Connection/fix_bug_on_admin_dashboard

Fix `Cannot read property countUser of null`
This commit is contained in:
mattwr18 2019-08-16 14:34:11 +02:00 committed by GitHub
commit d0dab6fdf8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 31 deletions

View File

@ -2,7 +2,7 @@
<span>
<no-ssr placeholder="0" tag="span">
<count-to
:start-val="lastEndVal || startVal"
:start-val="startVal"
:end-val="endVal"
:duration="duration"
:autoplay="autoplay"
@ -25,23 +25,5 @@ export default {
autoplay: { type: Boolean, default: true },
separator: { type: String, default: '.' },
},
data() {
return {
lastEndVal: null,
isReady: false,
}
},
watch: {
endVal(endVal) {
if (this.isReady && this.startVal === 0 && !this.lastEndVal) {
this.lastEndVal = this.endVal
}
},
},
mounted() {
setTimeout(() => {
this.isReady = true
}, 500)
},
}
</script>

View File

@ -7,7 +7,7 @@
<ds-space margin="small">
<ds-number :count="0" :label="$t('admin.dashboard.users')" size="x-large" uppercase>
<no-ssr slot="count">
<hc-count-to :start-val="0" :end-val="statistics.countUsers || 0" />
<hc-count-to :end-val="statistics.countUsers || 0" />
</no-ssr>
</ds-number>
</ds-space>
@ -16,7 +16,7 @@
<ds-space margin="small">
<ds-number :count="0" :label="$t('admin.dashboard.posts')" size="x-large" uppercase>
<no-ssr slot="count">
<hc-count-to :start-val="0" :end-val="statistics.countPosts || 0" />
<hc-count-to :end-val="statistics.countPosts || 0" />
</no-ssr>
</ds-number>
</ds-space>
@ -30,7 +30,7 @@
uppercase
>
<no-ssr slot="count">
<hc-count-to :start-val="0" :end-val="statistics.countComments || 0" />
<hc-count-to :end-val="statistics.countComments || 0" />
</no-ssr>
</ds-number>
</ds-space>
@ -44,7 +44,7 @@
uppercase
>
<no-ssr slot="count">
<hc-count-to :start-val="0" :end-val="statistics.countNotifications || 0" />
<hc-count-to :end-val="statistics.countNotifications || 0" />
</no-ssr>
</ds-number>
</ds-space>
@ -58,7 +58,7 @@
uppercase
>
<no-ssr slot="count">
<hc-count-to :start-val="0" :end-val="statistics.countOrganizations || 0" />
<hc-count-to :end-val="statistics.countOrganizations || 0" />
</no-ssr>
</ds-number>
</ds-space>
@ -72,7 +72,7 @@
uppercase
>
<no-ssr slot="count">
<hc-count-to :start-val="0" :end-val="statistics.countProjects || 0" />
<hc-count-to :end-val="statistics.countProjects || 0" />
</no-ssr>
</ds-number>
</ds-space>
@ -81,7 +81,7 @@
<ds-space margin="small">
<ds-number :count="0" :label="$t('admin.dashboard.invites')" size="x-large" uppercase>
<no-ssr slot="count">
<hc-count-to :start-val="0" :end-val="statistics.countInvites || 0" />
<hc-count-to :end-val="statistics.countInvites || 0" />
</no-ssr>
</ds-number>
</ds-space>
@ -90,7 +90,7 @@
<ds-space margin="small">
<ds-number :count="0" :label="$t('admin.dashboard.follows')" size="x-large" uppercase>
<no-ssr slot="count">
<hc-count-to :start-val="0" :end-val="statistics.countFollows || 0" />
<hc-count-to :end-val="statistics.countFollows || 0" />
</no-ssr>
</ds-number>
</ds-space>
@ -99,7 +99,7 @@
<ds-space margin="small">
<ds-number :count="0" :label="$t('admin.dashboard.shouts')" size="x-large" uppercase>
<no-ssr slot="count">
<hc-count-to :start-val="0" :end-val="statistics.countShouts || 0" />
<hc-count-to :end-val="statistics.countShouts || 0" />
</no-ssr>
</ds-number>
</ds-space>
@ -128,9 +128,6 @@ export default {
return process.client
},
},
mounted() {
this.$apollo.queries.statistics.startPolling(5000)
},
apollo: {
statistics: {
query: gql`