Fix status loading by instance
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed

This commit is contained in:
Mathias Koehler 2023-03-25 00:30:40 +01:00
parent 0802dc5777
commit 81736cebf5
Signed by untrusted user: interru
GPG key ID: E01E350F5E2A884A

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)
}
},