diff options
| author | shpuld <shp@cock.li> | 2019-03-28 22:25:40 +0200 |
|---|---|---|
| committer | shpuld <shp@cock.li> | 2019-03-28 22:25:40 +0200 |
| commit | 31010779f6cc1abdd18fa117c0832e20623e1624 (patch) | |
| tree | 2eaf8861e1baee86a1f4d33e0e10543e62cdd98c /src/components/user_card | |
| parent | fd12263cacd2a869ad61dd8580f918b45d9b2a51 (diff) | |
| parent | c829b1a5f4a013882ba298b0f95ec0f8b3ed3758 (diff) | |
Merge branch 'develop' into feature/mobile-improvements-3
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> |
