Fix #822 by updating the counts of the user

The load more button depends on the total of the posts available.
Removing posts changes the total counts, so we have to manually update
it.
This commit is contained in:
Robert Schäfer 2019-07-13 23:00:41 +02:00
parent 4c91d8fbc5
commit 585e798dc0

View File

@ -202,11 +202,11 @@
<template v-if="activePosts.length">
<hc-post-card
v-for="(post, index) in activePosts"
v-for="post in activePosts"
:key="post.id"
:post="post"
:width="{ base: '100%', md: '100%', xl: '50%' }"
@removePostFromList="activePosts.splice(index, 1)"
@removePostFromList="removePostFromList"
/>
</template>
<template v-else-if="$apollo.loading">
@ -331,6 +331,10 @@ export default {
},
},
methods: {
removePostFromList(index) {
this.activePosts.splice(index, 1)
this.$apollo.queries.User.refetch()
},
handleTab(tab) {
this.tabActive = tab
this.Post = null