1
0

Show loading spinner when loading namespaces & lists

This commit is contained in:
kolaente
2020-11-12 20:57:39 +01:00
parent 50b1d378e0
commit 15a2da41ba
5 changed files with 24 additions and 3 deletions

View File

@ -1,6 +1,7 @@
import Vue from 'vue'
import NamespaceService from '../../services/namespace'
import {setLoading} from '@/store/helper'
export default {
namespaced: true,
@ -87,6 +88,8 @@ export default {
},
actions: {
loadNamespaces(ctx) {
const cancel = setLoading(ctx)
const namespaceService = new NamespaceService()
// We always load all namespaces and filter them on the frontend
return namespaceService.getAll({}, {is_archived: true})
@ -108,6 +111,9 @@ export default {
.catch(e => {
return Promise.reject(e)
})
.finally(() => {
cancel()
})
},
loadNamespacesIfFavoritesDontExist(ctx) {
// The first namespace should be the one holding all favorites