Fix reactivity flow for user moderation from status show page

This commit is contained in:
Angelina Filippova 2020-05-28 21:15:58 +03:00
parent 03b5c1d76e
commit 63ad2f4524
2 changed files with 11 additions and 1 deletions

View file

@ -95,6 +95,12 @@ const status = {
commit('SET_LOADING', false)
dispatch('FetchUserStatuses', { userId: state.fetchedStatus.account.id, godmode: false })
},
FetchStatusAfterUserModeration({ commit, dispatch, getters, state }, id) {
commit('SET_LOADING', true)
fetchStatus(id, getters.authHost, getters.token)
.then((status) => dispatch('SetStatus', status.data))
commit('SET_LOADING', false)
},
async FetchStatusesCount({ commit, getters }, instance) {
commit('SET_LOADING', true)
const { data } = await fetchStatusesCount(instance, getters.authHost, getters.token)
@ -178,6 +184,10 @@ const status = {
},
HandlePageChange({ commit }, page) {
commit('CHANGE_PAGE', page)
},
SetStatus({ commit }, status) {
commit('SET_STATUS', status)
commit('SET_STATUS_AUTHOR', status.account)
}
}
}

View file

@ -97,7 +97,7 @@ const users = {
dispatch('SearchUsers', { query: state.searchQuery, page: state.currentPage })
}
if (statusId) {
dispatch('FetchStatus', statusId)
dispatch('FetchStatusAfterUserModeration', statusId)
} else if (userId) {
dispatch('FetchUserProfile', { userId, godmode: false })
}