feature: sum fail fix

This commit is contained in:
ogerly 2020-04-15 11:27:29 +02:00
parent 9fe882b39b
commit 026cd97a57

View File

@ -204,7 +204,6 @@ export default {
this.posts = searchPosts.posts this.posts = searchPosts.posts
this.postCount = searchPosts.postCount this.postCount = searchPosts.postCount
if (this.postCount > 0) this.activeTab = 'Post' if (this.postCount > 0) this.activeTab = 'Post'
this.searchCount = ( this.postCount + this.userCount + this.hashtagCount )
}, },
fetchPolicy: 'cache-and-network', fetchPolicy: 'cache-and-network',
}, },
@ -248,6 +247,8 @@ export default {
update({ searchHashtags }) { update({ searchHashtags }) {
this.hashtags = searchHashtags.hashtags this.hashtags = searchHashtags.hashtags
this.hashtagCount = searchHashtags.hashtagCount this.hashtagCount = searchHashtags.hashtagCount
this.searchCount = this.postCount + this.userCount + this.hashtagCount
if (this.postCount === 0 && this.userCount === 0 && this.hashtagCount > 0) if (this.postCount === 0 && this.userCount === 0 && this.hashtagCount > 0)
this.activeTab = 'Hashtag' this.activeTab = 'Hashtag'
}, },