fetch reblogged users
This commit is contained in:
parent
2d339cd3b8
commit
85457fc917
6 changed files with 50 additions and 1 deletions
|
@ -122,6 +122,7 @@ const conversation = {
|
|||
.then(({ancestors, descendants}) => {
|
||||
const ancestorId = ancestors.length ? ancestors[0].id : this.status.id
|
||||
this.fetchFavouritedByUsers(ancestorId)
|
||||
this.fetchRebloggedByUsers(ancestorId)
|
||||
this.$store.dispatch('addNewStatuses', { statuses: ancestors })
|
||||
this.$store.dispatch('addNewStatuses', { statuses: descendants })
|
||||
})
|
||||
|
@ -160,6 +161,14 @@ const conversation = {
|
|||
this.$store.dispatch('addFavoritedByUsers', { favoritedByUsers, id })
|
||||
})
|
||||
},
|
||||
fetchRebloggedByUsers (id) {
|
||||
this.$store.state.api.backendInteractor.fetchRebloggedByUsers({id: this.status.id}).then((response) => {
|
||||
const rebloggedByUsers = response.map(item => ({
|
||||
src: item.avatar_static,
|
||||
name: item.display_name
|
||||
}))
|
||||
this.$store.dispatch('addRebloggedByUsers', { rebloggedByUsers, id })
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -262,6 +262,8 @@ const Status = {
|
|||
favouritedByUsers () {
|
||||
return this.statusoid.favoritedBy ? this.statusoid.favoritedBy : []
|
||||
},
|
||||
rebloggedByUsers () {
|
||||
return this.statusoid.rebloggedBy ? this.statusoid.rebloggedBy : []
|
||||
}
|
||||
},
|
||||
components: {
|
||||
|
|
|
@ -142,6 +142,16 @@
|
|||
<favorite-button :loggedIn='loggedIn' :status='status'></favorite-button>
|
||||
<delete-button :status='status'></delete-button>
|
||||
</div>
|
||||
<div class="boosted-users">
|
||||
<div class="reblogged-users" v-if="rebloggedByUsers.length > 0" :class="{ 'status-fadein': rebloggedByUsers.length > 0 }">
|
||||
<p class="title">Boosted By {{rebloggedByUsers.length}}:</p>
|
||||
<AvatarList :avatars='rebloggedByUsers'></AvatarList>
|
||||
</div>
|
||||
<div class="favourited-users" v-if="favouritedByUsers.length > 0" :class="{ 'status-fadein': favouritedByUsers.length > 0 }">
|
||||
<p class="title">Favourited By {{favouritedByUsers.length}}:</p>
|
||||
<AvatarList :avatars='favouritedByUsers'></AvatarList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container" v-if="replying">
|
||||
|
@ -612,6 +622,21 @@ a.unmute {
|
|||
}
|
||||
}
|
||||
|
||||
.boosted-users {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 10px;
|
||||
|
||||
.favourited-users,
|
||||
.reblogged-users {
|
||||
flex: 1;
|
||||
|
||||
.title {
|
||||
margin: 0 0 10px 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media all and (max-width: 800px) {
|
||||
.status-el {
|
||||
.retweet-info {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue