From 5699872bb5e05b5dc576c75cac2c79b7ece3f2ac Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Wed, 8 Mar 2017 18:04:21 +0100 Subject: [PATCH] Use user cache in users module. --- src/modules/users.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/users.js b/src/modules/users.js index dc910c91..9367ec68 100644 --- a/src/modules/users.js +++ b/src/modules/users.js @@ -1,5 +1,5 @@ import backendInteractorService from '../services/backend_interactor_service/backend_interactor_service.js' -import { compact, map, each, find, merge } from 'lodash' +import { compact, map, each, merge } from 'lodash' import { set } from 'vue' // TODO: Unify with mergeOrAdd in statuses.js @@ -20,7 +20,7 @@ export const mergeOrAdd = (arr, obj, item) => { export const mutations = { setMuted (state, { user: {id}, muted }) { - const user = find(state.users, {id}) + const user = state.usersObject[id] set(user, 'muted', muted) }, setCurrentUser (state, user) { @@ -36,7 +36,7 @@ export const mutations = { each(users, (user) => mergeOrAdd(state.users, state.usersObject, user)) }, setUserForStatus (state, status) { - status.user = find(state.users, status.user) + status.user = state.usersObject[status.user.id] } }