From 7afa541a53c1b00e8f7fb6f5d211789b3e4c52bb Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 30 Oct 2018 14:34:32 +0900 Subject: [PATCH] Fix #3040 --- .../views/components/follow-button.vue | 14 ++++-------- .../mobile/views/components/follow-button.vue | 22 ++++++++----------- src/services/blocking/create.ts | 8 +++++-- src/services/following/create.ts | 4 +++- src/services/following/delete.ts | 4 +++- src/services/following/requests/accept.ts | 4 +++- src/services/following/requests/reject.ts | 4 +++- 7 files changed, 31 insertions(+), 29 deletions(-) diff --git a/src/client/app/desktop/views/components/follow-button.vue b/src/client/app/desktop/views/components/follow-button.vue index 4d3d61dfe..11291a2f1 100644 --- a/src/client/app/desktop/views/components/follow-button.vue +++ b/src/client/app/desktop/views/components/follow-button.vue @@ -40,8 +40,8 @@ export default Vue.extend({ mounted() { this.connection = (this as any).os.stream.useSharedConnection('main'); - this.connection.on('follow', this.onFollow); - this.connection.on('unfollow', this.onUnfollow); + this.connection.on('follow', this.onFollowChange); + this.connection.on('unfollow', this.onFollowChange); }, beforeDestroy() { @@ -49,17 +49,11 @@ export default Vue.extend({ }, methods: { - onFollow(user) { - if (user.id == this.u.id) { - this.u.isFollowing = user.isFollowing; - this.u.hasPendingFollowRequestFromYou = user.hasPendingFollowRequestFromYou; - } - }, - - onUnfollow(user) { + onFollowChange(user) { if (user.id == this.u.id) { this.u.isFollowing = user.isFollowing; this.u.hasPendingFollowRequestFromYou = user.hasPendingFollowRequestFromYou; + this.$forceUpdate(); } }, diff --git a/src/client/app/mobile/views/components/follow-button.vue b/src/client/app/mobile/views/components/follow-button.vue index 3c8b2f98e..1bf08802b 100644 --- a/src/client/app/mobile/views/components/follow-button.vue +++ b/src/client/app/mobile/views/components/follow-button.vue @@ -17,6 +17,7 @@