mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 14:31:26 +00:00
Update Profile, add unfollow button to following modal
This commit is contained in:
parent
99503ec464
commit
0d34ffa142
1 changed files with 19 additions and 0 deletions
|
@ -397,6 +397,14 @@
|
|||
{{user.display_name}}
|
||||
</p>
|
||||
</div>
|
||||
<div v-if="owner">
|
||||
<a class="btn btn-outline-secondary btn-sm" href="#" @click.prevent="followModalAction(user.id, index, 'following')">Unfollow</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="following.length == 0" class="list-group-item border-0">
|
||||
<div class="list-group-item border-0">
|
||||
<p class="p-3 text-center mb-0 lead">You are not following anyone.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="followingMore" class="list-group-item text-center" v-on:click="followingLoadMore()">
|
||||
|
@ -1025,6 +1033,17 @@ export default {
|
|||
return;
|
||||
}
|
||||
this.$refs.visitorContextMenu.show();
|
||||
},
|
||||
|
||||
followModalAction(id, index, type = 'following') {
|
||||
axios.post('/i/follow', {
|
||||
item: id
|
||||
}).then(res => {
|
||||
if(type == 'following') {
|
||||
this.following.splice(index, 1);
|
||||
this.profile.following_count--;
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue