mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 14:31:26 +00:00
Update Timeline, add unfollow button to following modal
This commit is contained in:
parent
0d34ffa142
commit
63dc9a3c2b
1 changed files with 17 additions and 1 deletions
|
@ -287,9 +287,15 @@
|
|||
{{user.display_name}}
|
||||
</p>
|
||||
</div>
|
||||
<a class="btn btn-outline-secondary btn-sm" href="#" @click.prevent="followModalAction(user.id, index, 'following')">Unfollow</a>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="followingMore" class="list-group-item text-center" v-on:click="followingLoadMore()">
|
||||
<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="following.length != 0 && followingMore" class="list-group-item text-center" v-on:click="followingLoadMore()">
|
||||
<p class="mb-0 small text-muted font-weight-light cursor-pointer">Load more</p>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -973,6 +979,16 @@
|
|||
}).then(res => {
|
||||
this.suggestions.splice(index, 1);
|
||||
})
|
||||
},
|
||||
|
||||
followModalAction(id, index, type = 'following') {
|
||||
axios.post('/i/follow', {
|
||||
item: id
|
||||
}).then(res => {
|
||||
if(type == 'following') {
|
||||
this.following.splice(index, 1);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue