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