Also add retweeted users to user store.

This commit is contained in:
Roger Braun 2016-12-08 09:08:59 +01:00
parent 7b5a30db14
commit f18f87747f

View File

@ -1,6 +1,6 @@
import timelineFetcher from '../services/timeline_fetcher/timeline_fetcher.service.js' import timelineFetcher from '../services/timeline_fetcher/timeline_fetcher.service.js'
import backendInteractorService from '../services/backend_interactor_service/backend_interactor_service.js' import backendInteractorService from '../services/backend_interactor_service/backend_interactor_service.js'
import { map, each, find, merge } from 'lodash' import { compact, map, each, find, merge } from 'lodash'
// TODO: Unify with mergeOrAdd in statuses.js // TODO: Unify with mergeOrAdd in statuses.js
export const mergeOrAdd = (arr, item) => { export const mergeOrAdd = (arr, item) => {
@ -44,7 +44,9 @@ const users = {
actions: { actions: {
addNewStatuses (store, { statuses }) { addNewStatuses (store, { statuses }) {
const users = map(statuses, 'user') const users = map(statuses, 'user')
const retweetedUsers = compact(map(statuses, 'retweeted_status.user'))
store.commit('addNewUsers', users) store.commit('addNewUsers', users)
store.commit('addNewUsers', retweetedUsers)
}, },
loginUser (store, userCredentials) { loginUser (store, userCredentials) {
const commit = store.commit const commit = store.commit