Change computed to isMyMessage in toot

This commit is contained in:
AkiraFukushima 2019-01-23 23:43:10 +09:00
parent 58db5c1b25
commit 1b2a3f725a
1 changed files with 5 additions and 5 deletions

View File

@ -115,10 +115,10 @@
<li role="button" @click="block()"> <li role="button" @click="block()">
{{ $t('cards.toot.block') }} {{ $t('cards.toot.block') }}
</li> </li>
<li role="button" @click="reportUser()" v-if="!isMyMessage()"> <li role="button" @click="reportUser()" v-if="!isMyMessage">
{{ $t('cards.toot.report') }} {{ $t('cards.toot.report') }}
</li> </li>
<li role="button" class="separate" @click="deleteToot(message)" v-if="isMyMessage()"> <li role="button" class="separate" @click="deleteToot(message)" v-if="isMyMessage">
{{ $t('cards.toot.delete') }} {{ $t('cards.toot.delete') }}
</li> </li>
</ul> </ul>
@ -220,6 +220,9 @@ export default {
return this.originalMessage.favourites_count return this.originalMessage.favourites_count
} }
return '' return ''
},
isMyMessage: function () {
return this.$store.state.TimelineSpace.account.accountId === this.originalMessage.account.id
} }
}, },
mounted () { mounted () {
@ -410,9 +413,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)
}, },
isMyMessage () {
return this.$store.state.TimelineSpace.account.accountId === this.originalMessage.account.id
},
deleteToot (message) { deleteToot (message) {
this.$store.dispatch('molecules/Toot/deleteToot', message) this.$store.dispatch('molecules/Toot/deleteToot', message)
.then((message) => { .then((message) => {