fetch favorited users
This commit is contained in:
parent
fd3811d651
commit
2d339cd3b8
5 changed files with 60 additions and 2 deletions
|
@ -120,6 +120,8 @@ const conversation = {
|
|||
if (this.status) {
|
||||
this.$store.state.api.backendInteractor.fetchConversation({id: this.status.id})
|
||||
.then(({ancestors, descendants}) => {
|
||||
const ancestorId = ancestors.length ? ancestors[0].id : this.status.id
|
||||
this.fetchFavouritedByUsers(ancestorId)
|
||||
this.$store.dispatch('addNewStatuses', { statuses: ancestors })
|
||||
this.$store.dispatch('addNewStatuses', { statuses: descendants })
|
||||
})
|
||||
|
@ -148,6 +150,16 @@ const conversation = {
|
|||
if (!this.expanded) {
|
||||
this.setHighlight(null)
|
||||
}
|
||||
},
|
||||
fetchFavouritedByUsers (id) {
|
||||
this.$store.state.api.backendInteractor.fetchFavouritedByUsers({id: this.status.id}).then((response) => {
|
||||
const favoritedByUsers = response.map(item => ({
|
||||
src: item.avatar_static,
|
||||
name: item.display_name
|
||||
}))
|
||||
this.$store.dispatch('addFavoritedByUsers', { favoritedByUsers, id })
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import UserCard from '../user_card/user_card.vue'
|
|||
import UserAvatar from '../user_avatar/user_avatar.vue'
|
||||
import Gallery from '../gallery/gallery.vue'
|
||||
import LinkPreview from '../link-preview/link-preview.vue'
|
||||
import AvatarList from '../avatar_list/avatar_list.vue'
|
||||
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
|
||||
import fileType from 'src/services/file_type/file_type.service'
|
||||
import { highlightClass, highlightStyle } from '../../services/user_highlighter/user_highlighter.js'
|
||||
|
@ -257,6 +258,10 @@ const Status = {
|
|||
return this.status.statusnet_html
|
||||
}
|
||||
return this.status.summary_html + '<br />' + this.status.statusnet_html
|
||||
},
|
||||
favouritedByUsers () {
|
||||
return this.statusoid.favoritedBy ? this.statusoid.favoritedBy : []
|
||||
},
|
||||
}
|
||||
},
|
||||
components: {
|
||||
|
@ -268,7 +273,8 @@ const Status = {
|
|||
UserCard,
|
||||
UserAvatar,
|
||||
Gallery,
|
||||
LinkPreview
|
||||
LinkPreview,
|
||||
AvatarList
|
||||
},
|
||||
methods: {
|
||||
visibilityIcon (visibility) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue