diff options
| author | dave <starpumadev@gmail.com> | 2019-03-25 10:22:16 -0400 |
|---|---|---|
| committer | dave <starpumadev@gmail.com> | 2019-03-25 10:22:16 -0400 |
| commit | 4cec0d589dfc54987ec6f024b0a463d0abd847d2 (patch) | |
| tree | a88953cc409d162127edb43a702d6540c64c023e /src/components/user_card/user_card.js | |
| parent | 63d7c7bd80cf8028cdefee99c1cb75614385f96b (diff) | |
| parent | 01d05316998f90451e920f8ac8d4c264a13b0cd7 (diff) | |
Merge branch 'develop' of https://git.pleroma.social/pleroma/pleroma-fe into issue-433-status-reply-form
Diffstat (limited to 'src/components/user_card/user_card.js')
| -rw-r--r-- | src/components/user_card/user_card.js | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/src/components/user_card/user_card.js b/src/components/user_card/user_card.js index 80d15a27..197c61d5 100644 --- a/src/components/user_card/user_card.js +++ b/src/components/user_card/user_card.js @@ -1,4 +1,5 @@ import UserAvatar from '../user_avatar/user_avatar.vue' +import RemoteFollow from '../remote_follow/remote_follow.vue' import { hex2rgb } from '../../services/color_convert/color_convert.js' import { requestFollow, requestUnfollow } from '../../services/follow_manipulate/follow_manipulate' import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator' @@ -15,6 +16,9 @@ export default { betterShadow: this.$store.state.interface.browserSupport.cssFilter } }, + created () { + this.$store.dispatch('fetchUserRelationship', this.user.id) + }, computed: { classes () { return [{ @@ -96,7 +100,8 @@ export default { } }, components: { - UserAvatar + UserAvatar, + RemoteFollow }, methods: { followUser () { @@ -116,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) { |
