reactivity fixes

This commit is contained in:
Henry Jameson 2019-03-22 00:05:20 +02:00
parent 67719e9a23
commit e617ed285e
2 changed files with 4 additions and 3 deletions

View file

@ -1,4 +1,5 @@
import { remove, slice, each, find, maxBy, minBy, merge, first, last, isArray, omitBy } from 'lodash'
import { set } from 'vue'
import apiService from '../services/api/api.service.js'
// import parse from '../services/status_parser/status_parser.js'
@ -82,7 +83,7 @@ const mergeOrAdd = (arr, obj, item) => {
// This is a new item, prepare it
prepareStatus(item)
arr.push(item)
obj[item.id] = item
set(obj, item.id, item)
return {item, new: true}
}
}

View file

@ -16,9 +16,9 @@ export const mergeOrAdd = (arr, obj, item) => {
} else {
// This is a new item, prepare it
arr.push(item)
obj[item.id] = item
set(obj, item.id, item)
if (item.screen_name && !item.screen_name.includes('@')) {
obj[item.screen_name.toLowerCase()] = item
set(obj, item.screen_name.toLowerCase(), item)
}
return { item, new: true }
}