aboutsummaryrefslogtreecommitdiff
path: root/src/components/conversation/conversation.js
diff options
context:
space:
mode:
authorBrenden Bice <brenden.next@gmail.com>2019-04-01 22:29:45 -0400
committerBrenden Bice <brenden.next@gmail.com>2019-04-11 23:26:12 -0400
commit2d339cd3b8b3ffc1509c954f68636d8ed4d37253 (patch)
tree0f32e01495eff840132faa00bc10979bf8fc5965 /src/components/conversation/conversation.js
parentfd3811d651f5be0c74f33850df2e95ed18f86a0c (diff)
fetch favorited users
Diffstat (limited to 'src/components/conversation/conversation.js')
-rw-r--r--src/components/conversation/conversation.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js
index 30600f73..b3335f64 100644
--- a/src/components/conversation/conversation.js
+++ b/src/components/conversation/conversation.js
@@ -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 })
+ })
+ },
}
}
}