Fix profiles without statuses not loading

This commit is contained in:
Shpuld Shpludson 2018-12-31 01:57:22 +00:00 committed by HJ
parent 1316ed43a5
commit fb8f774383
4 changed files with 100 additions and 126 deletions

View file

@ -86,6 +86,13 @@ export const mutations = {
}
}
export const getters = {
userById: state => id =>
state.users.find(user => user.id === id),
userByName: state => name =>
state.users.find(user => user.screen_name === name)
}
export const defaultState = {
loggingIn: false,
lastLoginName: false,
@ -99,6 +106,7 @@ export const defaultState = {
const users = {
state: defaultState,
mutations,
getters,
actions: {
fetchUser (store, id) {
store.rootState.api.backendInteractor.fetchUser({ id })