This commit is contained in:
syuilo
2018-10-30 14:34:32 +09:00
parent d399241e65
commit 7afa541a53
7 changed files with 31 additions and 29 deletions

View File

@@ -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();
}
},