This commit is contained in:
Henry Jameson 2019-03-25 20:11:06 +02:00
parent 3b5fc88989
commit cb122e3a99

View file

@ -27,7 +27,7 @@ const conversation = {
data () { data () {
return { return {
highlight: null, highlight: null,
relevantIds: [] converationStatusIds: []
} }
}, },
props: [ props: [
@ -39,8 +39,8 @@ const conversation = {
return this.statusoid return this.statusoid
}, },
idsToShow () { idsToShow () {
if (this.relevantIds.length > 0) { if (this.converationStatusIds.length > 0) {
return this.relevantIds return this.converationStatusIds
} else if (this.statusId) { } else if (this.statusId) {
return [this.statusId] return [this.statusId]
} else { } else {
@ -96,12 +96,11 @@ const conversation = {
methods: { methods: {
fetchConversation () { fetchConversation () {
if (this.status) { if (this.status) {
const conversationId = this.status.id this.$store.state.api.backendInteractor.fetchConversation({id: this.status.id})
this.$store.state.api.backendInteractor.fetchConversation({id: conversationId})
.then(({ancestors, descendants}) => { .then(({ancestors, descendants}) => {
this.$store.dispatch('addNewStatuses', { statuses: ancestors }) this.$store.dispatch('addNewStatuses', { statuses: ancestors })
this.$store.dispatch('addNewStatuses', { statuses: descendants }) this.$store.dispatch('addNewStatuses', { statuses: descendants })
set(this, 'relevantIds', [].concat( set(this, 'converationStatusIds', [].concat(
ancestors.map(_ => _.id), ancestors.map(_ => _.id),
this.statusId, this.statusId,
descendants.map(_ => _.id))) descendants.map(_ => _.id)))