aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/components/user_card_content/user_card_content.js36
1 files changed, 32 insertions, 4 deletions
diff --git a/src/components/user_card_content/user_card_content.js b/src/components/user_card_content/user_card_content.js
index 7a7b89d4..41e4e817 100644
--- a/src/components/user_card_content/user_card_content.js
+++ b/src/components/user_card_content/user_card_content.js
@@ -93,27 +93,55 @@ export default {
},
methods: {
followUser () {
+ const store = this.$store
this.followRequestInProgress = true
- requestFollow(this.user, this.$store).then(({sent}) => {
+ requestFollow(this.user, store).then(({sent}) => {
this.followRequestInProgress = false
this.followRequestSent = sent
+
+ store.dispatch('stopFetching', 'friends')
+ store.commit('clearTimeline', { timeline: 'friends' })
+ store.dispatch('startFetching', { timeline: 'friends' })
})
},
unfollowUser () {
+ const store = this.$store
this.followRequestInProgress = true
- requestUnfollow(this.user, this.$store).then(() => {
+ requestUnfollow(this.user, store).then(() => {
this.followRequestInProgress = false
+
+ store.dispatch('stopFetching', 'friends')
+ store.commit('clearTimeline', { timeline: 'friends' })
+ store.dispatch('startFetching', { timeline: 'friends' })
})
},
blockUser () {
const store = this.$store
store.state.api.backendInteractor.blockUser(this.user.id)
- .then((blockedUser) => store.commit('addNewUsers', [blockedUser]))
+ .then((blockedUser) => {
+ store.commit('addNewUsers', [blockedUser])
+
+ store.dispatch('stopFetching', 'friends')
+ store.commit('clearTimeline', { timeline: 'friends' })
+ store.dispatch('startFetching', { timeline: 'friends' })
+
+ store.commit('clearTimeline', { timeline: 'public' })
+ store.commit('clearTimeline', { timeline: 'publicAndExternal' })
+ })
},
unblockUser () {
const store = this.$store
store.state.api.backendInteractor.unblockUser(this.user.id)
- .then((unblockedUser) => store.commit('addNewUsers', [unblockedUser]))
+ .then((unblockedUser) => {
+ store.commit('addNewUsers', [unblockedUser])
+
+ store.dispatch('stopFetching', 'friends')
+ store.commit('clearTimeline', { timeline: 'friends' })
+ store.dispatch('startFetching', { timeline: 'friends' })
+
+ store.commit('clearTimeline', { timeline: 'public' })
+ store.commit('clearTimeline', { timeline: 'publicAndExternal' })
+ })
},
toggleMute () {
const store = this.$store