diff options
| author | jasper <jasper92341@hotmail.com> | 2019-02-15 07:52:34 -0800 |
|---|---|---|
| committer | jasper <jasper92341@hotmail.com> | 2019-02-15 07:52:34 -0800 |
| commit | 6c8ccf2733c780543a9afc5ffbe7942064ad2596 (patch) | |
| tree | 19d6e3b689bafe232de6f09818d72e1869b749de /src | |
| parent | 10990e17159a8b2cb3d6290b654f9c3f2a63c34e (diff) | |
Remove posts immediately by blocking
Diffstat (limited to 'src')
| -rw-r--r-- | src/components/user_card_content/user_card_content.js | 36 |
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 |
