Change computed to favouritesCount in toot

This commit is contained in:
AkiraFukushima 2019-01-23 23:41:06 +09:00
parent 6facd3ccfa
commit 58db5c1b25
1 changed files with 7 additions and 7 deletions

View File

@ -92,7 +92,7 @@
<icon name="star" scale="0.9"></icon> <icon name="star" scale="0.9"></icon>
</el-button> </el-button>
<span class="count"> <span class="count">
{{ favouritesCount() }} {{ favouritesCount }}
</span> </span>
<el-button class="pinned" type="text" :title="$t('cards.toot.pinned')" :aria-label="$t('cards.toot.pinned')" v-show="pinned"> <el-button class="pinned" type="text" :title="$t('cards.toot.pinned')" :aria-label="$t('cards.toot.pinned')" v-show="pinned">
<icon name="thumbtack" scale="0.9"></icon> <icon name="thumbtack" scale="0.9"></icon>
@ -214,6 +214,12 @@ export default {
return this.originalMessage.reblogs_count return this.originalMessage.reblogs_count
} }
return '' return ''
},
favouritesCount: function () {
if (this.originalMessage.favourites_count > 0) {
return this.originalMessage.favourites_count
}
return ''
} }
}, },
mounted () { mounted () {
@ -404,12 +410,6 @@ export default {
this.$store.dispatch('TimelineSpace/Contents/SideBar/AccountProfile/changeAccount', account) this.$store.dispatch('TimelineSpace/Contents/SideBar/AccountProfile/changeAccount', account)
this.$store.commit('TimelineSpace/Contents/SideBar/changeOpenSideBar', true) this.$store.commit('TimelineSpace/Contents/SideBar/changeOpenSideBar', true)
}, },
favouritesCount () {
if (this.originalMessage.favourites_count > 0) {
return this.originalMessage.favourites_count
}
return ''
},
isMyMessage () { isMyMessage () {
return this.$store.state.TimelineSpace.account.accountId === this.originalMessage.account.id return this.$store.state.TimelineSpace.account.accountId === this.originalMessage.account.id
}, },