Use state object for user view instead of timeline.
Also fetch user if not in the state already.
This commit is contained in:
parent
55c4818084
commit
07057043d9
4 changed files with 21 additions and 2 deletions
|
@ -57,6 +57,10 @@ const users = {
|
|||
state: defaultState,
|
||||
mutations,
|
||||
actions: {
|
||||
fetchUser (store, id) {
|
||||
store.rootState.api.backendInteractor.fetchUser({id})
|
||||
.then((user) => store.commit('addNewUsers', user))
|
||||
},
|
||||
addNewStatuses (store, { statuses }) {
|
||||
const users = map(statuses, 'user')
|
||||
const retweetedUsers = compact(map(statuses, 'retweeted_status.user'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue