aboutsummaryrefslogtreecommitdiff
path: root/src/components/user_card/user_card.js
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2019-03-25 21:06:58 +0200
committerHenry Jameson <me@hjkos.com>2019-03-25 21:06:58 +0200
commit72749834f3c82847dd8b584cb0e0622a25f292f8 (patch)
tree5ef37dff498ca3daa03b80589d1b641167007501 /src/components/user_card/user_card.js
parentfaef769b40784c32b095db24d16a92c80ce7ea1f (diff)
parent854d0e80512d2da80cd5153144698a5148da4aa6 (diff)
Merge remote-tracking branch 'upstream/develop' into masto-api/direct
* upstream/develop: (40 commits) review Update attachment normalizer Add fallback for attachments uploaded via the other platforms Get correct mimetype through entity_normalizer Set default parameter Switch to mastoapi for posting status and uploading media Revert changes prevent text pasting if image is pasted remove border radius of suggested emojis #450 - dispatch login after saved state is loaded #448 - fix timeline fetch error when status text is null #451 - add class to username span No need to fetch mutes on load anymore 🙌 switch to mastoapi switch to mastoapi masto api sends muted property now No need to fetch user data using old api anymore 🎉 Switch to mastoapi reactivity fixes less hackery, more direct usage of mastoapi ...
Diffstat (limited to 'src/components/user_card/user_card.js')
-rw-r--r--src/components/user_card/user_card.js22
1 files changed, 7 insertions, 15 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) {