Add blocks.

This commit is contained in:
eal 2017-11-07 22:38:28 +02:00
parent 7ab7ac7be6
commit 608d1e6776
4 changed files with 54 additions and 0 deletions

View file

@ -46,6 +46,18 @@
</button>
</span>
</div>
<div class='block' v-if='isOtherUser'>
<span v-if='user.statusnet_blocking'>
<button @click="unblockUser" class="base04 base00-background pressed">
{{ $t('user_card.blocked') }}
</button>
</span>
<span v-if='!user.statusnet_blocking'>
<button @click="blockUser" class="base05 base02-background">
{{ $t('user_card.block') }}
</button>
</span>
</div>
</div>
</div>
</div>
@ -113,6 +125,16 @@
store.state.api.backendInteractor.unfollowUser(this.user.id)
.then((unfollowedUser) => store.commit('addNewUsers', [unfollowedUser]))
},
blockUser () {
const store = this.$store
store.state.api.backendInteractor.blockUser(this.user.id)
.then((blockedUser) => store.commit('addNewUsers', [blockedUser]))
},
unblockUser () {
const store = this.$store
store.state.api.backendInteractor.unblockUser(this.user.id)
.then((unblockedUser) => store.commit('addNewUsers', [unblockedUser]))
},
toggleMute () {
const store = this.$store
store.commit('setMuted', {user: this.user, muted: !this.user.muted})