Fix status loading by instance #18

Open
interru wants to merge 1 commit from interru/admin-fe:fix_status_by_instance into develop

View file

@ -114,7 +114,7 @@ const status = {
commit('SET_STATUSES_BY_INSTANCE', []) commit('SET_STATUSES_BY_INSTANCE', [])
} else { } else {
const statuses = state.statusesByInstance.selectedInstance === rootState.user.authHost const statuses = state.statusesByInstance.selectedInstance === rootState.user.authHost
? await fetchStatuses( ? (await fetchStatuses(
{ {
godmode: state.statusesByInstance.showPrivate, godmode: state.statusesByInstance.showPrivate,
localOnly: state.statusesByInstance.showLocal, localOnly: state.statusesByInstance.showLocal,
@ -122,17 +122,17 @@ const status = {
token: getters.token, token: getters.token,
pageSize: state.statusesByInstance.pageSize, pageSize: state.statusesByInstance.pageSize,
page: state.statusesByInstance.page page: state.statusesByInstance.page
}) })).data
: await fetchStatusesByInstance( : (await fetchStatusesByInstance(
{ {
instance: state.statusesByInstance.selectedInstance, instance: state.statusesByInstance.selectedInstance,
authHost: getters.authHost, authHost: getters.authHost,
token: getters.token, token: getters.token,
pageSize: state.statusesByInstance.pageSize, pageSize: state.statusesByInstance.pageSize,
page: state.statusesByInstance.page page: state.statusesByInstance.page
}) })).data.activities
commit('SET_STATUSES_BY_INSTANCE', statuses.data) commit('SET_STATUSES_BY_INSTANCE', statuses)
if (statuses.data.length < state.statusesByInstance.pageSize) { if (statuses.length < state.statusesByInstance.pageSize) {
commit('SET_ALL_LOADED', true) commit('SET_ALL_LOADED', true)
} }
} }
@ -141,7 +141,7 @@ const status = {
async FetchStatusesPageByInstance({ commit, getters, rootState, state }) { async FetchStatusesPageByInstance({ commit, getters, rootState, state }) {
commit('SET_BUTTON_LOADING', true) commit('SET_BUTTON_LOADING', true)
const statuses = state.statusesByInstance.selectedInstance === rootState.user.authHost const statuses = state.statusesByInstance.selectedInstance === rootState.user.authHost
? await fetchStatuses( ? (await fetchStatuses(
{ {
godmode: state.statusesByInstance.showPrivate, godmode: state.statusesByInstance.showPrivate,
localOnly: state.statusesByInstance.showLocal, localOnly: state.statusesByInstance.showLocal,
@ -149,18 +149,18 @@ const status = {
token: getters.token, token: getters.token,
pageSize: state.statusesByInstance.pageSize, pageSize: state.statusesByInstance.pageSize,
page: state.statusesByInstance.page page: state.statusesByInstance.page
}) })).data
: await fetchStatusesByInstance( : (await fetchStatusesByInstance(
{ {
instance: state.statusesByInstance.selectedInstance, instance: state.statusesByInstance.selectedInstance,
authHost: getters.authHost, authHost: getters.authHost,
token: getters.token, token: getters.token,
pageSize: state.statusesByInstance.pageSize, pageSize: state.statusesByInstance.pageSize,
page: state.statusesByInstance.page page: state.statusesByInstance.page
}) })).data.activities
commit('PUSH_STATUSES', statuses.data) commit('PUSH_STATUSES', statuses)
commit('SET_BUTTON_LOADING', false) commit('SET_BUTTON_LOADING', false)
if (statuses.data.length < state.statusesByInstance.pageSize) { if (statuses.length < state.statusesByInstance.pageSize) {
commit('SET_ALL_LOADED', true) commit('SET_ALL_LOADED', true)
} }
}, },