maintain conversationsObject storage

This commit is contained in:
taehoon 2019-04-11 12:46:06 -04:00
parent fa16d66c52
commit ab7a418d80
2 changed files with 40 additions and 14 deletions

View file

@ -1,4 +1,4 @@
import { reduce, filter, findIndex } from 'lodash'
import { reduce, filter, findIndex, clone } from 'lodash'
import Status from '../status/status.vue'
const sortById = (a, b) => {
@ -75,9 +75,7 @@ const conversation = {
return [this.status]
}
const statuses = this.$store.state.statuses.allStatuses
const conversation = filter(statuses, { statusnet_conversation_id: this.conversationId })
const conversation = clone(this.$store.state.statuses.conversationsObject[this.conversationId])
const statusIndex = findIndex(conversation, { id: this.statusId })
if (statusIndex !== -1) {
conversation[statusIndex] = this.status