diff options
| author | HJ <30-hj@users.noreply.git.pleroma.social> | 2019-03-25 19:21:48 +0000 |
|---|---|---|
| committer | HJ <30-hj@users.noreply.git.pleroma.social> | 2019-03-25 19:21:48 +0000 |
| commit | 04217fc6604ff6c4454ba0291c081a927a46d03c (patch) | |
| tree | e802758f03cf83e8089cbfa7fcec1aa520f43387 /src/components/user_card | |
| parent | fe13b1b75a42d03a813072633194f89385acec8e (diff) | |
| parent | 854d0e80512d2da80cd5153144698a5148da4aa6 (diff) | |
Merge branch 'develop' into 'mastoapi/friends-tl'
# Conflicts:
# src/services/api/api.service.js
Diffstat (limited to 'src/components/user_card')
| -rw-r--r-- | src/components/user_card/user_card.js | 22 | ||||
| -rw-r--r-- | src/components/user_card/user_card.vue | 4 |
2 files changed, 9 insertions, 17 deletions
diff --git a/src/components/user_card/user_card.js b/src/components/user_card/user_card.js index b07da675..197c61d5 100644 --- a/src/components/user_card/user_card.js +++ b/src/components/user_card/user_card.js @@ -121,24 +121,16 @@ export default { }) }, blockUser () { - const store = this.$store - store.state.api.backendInteractor.blockUser(this.user.id) - .then((blockedUser) => { - store.commit('addNewUsers', [blockedUser]) - store.commit('removeStatus', { timeline: 'friends', userId: this.user.id }) - store.commit('removeStatus', { timeline: 'public', userId: this.user.id }) - store.commit('removeStatus', { timeline: 'publicAndExternal', userId: this.user.id }) - }) + this.$store.dispatch('blockUser', this.user.id) }, unblockUser () { - const store = this.$store - store.state.api.backendInteractor.unblockUser(this.user.id) - .then((unblockedUser) => store.commit('addNewUsers', [unblockedUser])) + this.$store.dispatch('unblockUser', this.user.id) }, - toggleMute () { - const store = this.$store - store.commit('setMuted', {user: this.user, muted: !this.user.muted}) - store.state.api.backendInteractor.setUserMute(this.user) + muteUser () { + this.$store.dispatch('muteUser', this.user.id) + }, + unmuteUser () { + this.$store.dispatch('unmuteUser', this.user.id) }, setProfileView (v) { if (this.switcher) { diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue index f4114e6e..3259d1c5 100644 --- a/src/components/user_card/user_card.vue +++ b/src/components/user_card/user_card.vue @@ -74,12 +74,12 @@ </div> <div class='mute' v-if='isOtherUser && loggedIn'> <span v-if='user.muted'> - <button @click="toggleMute" class="pressed"> + <button @click="unmuteUser" class="pressed"> {{ $t('user_card.muted') }} </button> </span> <span v-if='!user.muted'> - <button @click="toggleMute"> + <button @click="muteUser"> {{ $t('user_card.mute') }} </button> </span> |
