diff options
| author | Henry Jameson <me@hjkos.com> | 2019-03-21 23:45:18 +0200 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2019-03-21 23:45:18 +0200 |
| commit | 67719e9a23da1420e8edbd41265cf6f46995b4b8 (patch) | |
| tree | 6493f1ee28f019612d21a6a5bcb7dc40b9852801 /src/components/conversation/conversation.js | |
| parent | d6c62fa50f1992c109c60d03aa44f5ed3ee94284 (diff) | |
less hackery, more direct usage of mastoapi
Diffstat (limited to 'src/components/conversation/conversation.js')
| -rw-r--r-- | src/components/conversation/conversation.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js index e543102a..ff18a9c8 100644 --- a/src/components/conversation/conversation.js +++ b/src/components/conversation/conversation.js @@ -1,4 +1,5 @@ import { reduce, filter } from 'lodash' +import { set } from 'vue' import Status from '../status/status.vue' const sortById = (a, b) => { @@ -97,9 +98,13 @@ const conversation = { if (this.status) { const conversationId = this.status.id this.$store.state.api.backendInteractor.fetchConversation({id: conversationId}) - .then((statuses) => { - this.$store.dispatch('addNewStatuses', { statuses }) - statuses.forEach(status => this.relevantIds.push(status.id)) + .then(({ancestors, descendants}) => { + this.$store.dispatch('addNewStatuses', { statuses: ancestors }) + this.$store.dispatch('addNewStatuses', { statuses: descendants }) + set(this, 'relevantIds', [].concat( + ancestors.map(_ => _.id), + this.statusId, + descendants.map(_ => _.id))) }) .then(() => this.setHighlight(this.statusId)) } else { |
