Add users from search results to the global store
fixes user cards
This commit is contained in:
parent
3551289a86
commit
5d924d0a16
1 changed files with 5 additions and 5 deletions
|
@ -766,13 +766,13 @@ const statuses = {
|
||||||
rootState.api.backendInteractor.fetchRebloggedByUsers({ id })
|
rootState.api.backendInteractor.fetchRebloggedByUsers({ id })
|
||||||
.then(rebloggedByUsers => commit('addRepeats', { id, rebloggedByUsers, currentUser: rootState.users.currentUser }))
|
.then(rebloggedByUsers => commit('addRepeats', { id, rebloggedByUsers, currentUser: rootState.users.currentUser }))
|
||||||
},
|
},
|
||||||
search (store, { q, resolve, limit, offset, following, type }) {
|
search ({ rootState, dispatch }, { q, resolve, limit, offset, following, type }) {
|
||||||
return store.rootState.api.backendInteractor.search2({ q, resolve, limit, offset, following, type })
|
return rootState.api.backendInteractor.search2({ q, resolve, limit, offset, following, type })
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
store.commit('addNewUsers', data.accounts)
|
dispatch('addNewUsers', data.accounts)
|
||||||
store.commit('addNewStatuses', { statuses: data.statuses })
|
dispatch('addNewStatuses', { statuses: data.statuses })
|
||||||
if ('media' in data) {
|
if ('media' in data) {
|
||||||
store.commit('addNewStatuses', { statuses: data.media })
|
dispatch('addNewStatuses', { statuses: data.media })
|
||||||
}
|
}
|
||||||
return data
|
return data
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue