mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 14:31:26 +00:00
Update Timeline component, cascade relationship state change
This commit is contained in:
parent
0436b124e4
commit
f4bd5672b1
1 changed files with 26 additions and 2 deletions
|
@ -12,7 +12,7 @@
|
|||
<div style="margin-top:-2px;">
|
||||
<story-component v-if="config.features.stories" :scope="scope"></story-component>
|
||||
</div>
|
||||
<div>
|
||||
<div class="pt-4">
|
||||
<div v-if="loading" class="text-center" style="padding-top:10px;">
|
||||
<div class="spinner-border" role="status">
|
||||
<span class="sr-only">Loading...</span>
|
||||
|
@ -106,6 +106,8 @@
|
|||
size="small"
|
||||
v-on:status-delete="deleteStatus"
|
||||
v-on:comment-focus="commentFocus"
|
||||
v-on:followed="followedAccount"
|
||||
v-on:unfollowed="unfollowedAccount"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
@ -1067,7 +1069,29 @@
|
|||
this.feed = this.feed.filter(s => {
|
||||
return s.id != status;
|
||||
});
|
||||
},
|
||||
|
||||
followedAccount(id) {
|
||||
this.feed = this.feed.map(s => {
|
||||
if(s.account.id == id) {
|
||||
if(s.hasOwnProperty('relationship') && s.relationship.following == false) {
|
||||
s.relationship.following = true;
|
||||
}
|
||||
}
|
||||
return s;
|
||||
});
|
||||
},
|
||||
|
||||
unfollowedAccount(id) {
|
||||
this.feed = this.feed.map(s => {
|
||||
if(s.account.id == id) {
|
||||
if(s.hasOwnProperty('relationship') && s.relationship.following == true) {
|
||||
s.relationship.following = false;
|
||||
}
|
||||
}
|
||||
return s;
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
beforeDestroy () {
|
||||
|
|
Loading…
Reference in a new issue