Fix loading states for unrelated components (#370)
Co-authored-by: kolaente <k@knt.li> Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/370 Co-authored-by: konrad <konrad@kola-entertainments.de> Co-committed-by: konrad <konrad@kola-entertainments.de>
This commit is contained in:
@ -114,7 +114,7 @@ export default {
|
||||
},
|
||||
actions: {
|
||||
loadBucketsForList(ctx, {listId, params}) {
|
||||
const cancel = setLoading(ctx)
|
||||
const cancel = setLoading(ctx, 'kanban')
|
||||
|
||||
// Clear everything to prevent having old buckets in the list if loading the buckets from this list takes a few moments
|
||||
ctx.commit('setBuckets', [])
|
||||
@ -134,7 +134,7 @@ export default {
|
||||
})
|
||||
},
|
||||
createBucket(ctx, bucket) {
|
||||
const cancel = setLoading(ctx)
|
||||
const cancel = setLoading(ctx, 'kanban')
|
||||
|
||||
const bucketService = new BucketService()
|
||||
return bucketService.create(bucket)
|
||||
@ -150,7 +150,7 @@ export default {
|
||||
})
|
||||
},
|
||||
deleteBucket(ctx, bucket) {
|
||||
const cancel = setLoading(ctx)
|
||||
const cancel = setLoading(ctx, 'kanban')
|
||||
|
||||
const bucketService = new BucketService()
|
||||
return bucketService.delete(bucket)
|
||||
@ -168,7 +168,7 @@ export default {
|
||||
})
|
||||
},
|
||||
updateBucket(ctx, bucket) {
|
||||
const cancel = setLoading(ctx)
|
||||
const cancel = setLoading(ctx, 'kanban')
|
||||
|
||||
const bucketService = new BucketService()
|
||||
return bucketService.update(bucket)
|
||||
|
@ -7,7 +7,6 @@ export default {
|
||||
namespaced: true,
|
||||
state: () => ({
|
||||
namespaces: [],
|
||||
loading: false,
|
||||
}),
|
||||
mutations: {
|
||||
namespaces(state, namespaces) {
|
||||
@ -97,9 +96,7 @@ export default {
|
||||
},
|
||||
actions: {
|
||||
loadNamespaces(ctx) {
|
||||
const cancel = setLoading(ctx, status => {
|
||||
ctx.commit('loading', status, {root: true})
|
||||
})
|
||||
const cancel = setLoading(ctx, 'namespaces')
|
||||
|
||||
const namespaceService = new NamespaceService()
|
||||
// We always load all namespaces and filter them on the frontend
|
||||
|
@ -10,7 +10,7 @@ export default {
|
||||
state: () => ({}),
|
||||
actions: {
|
||||
update(ctx, task) {
|
||||
const cancel = setLoading(ctx)
|
||||
const cancel = setLoading(ctx, 'tasks')
|
||||
|
||||
const taskService = new TaskService()
|
||||
return taskService.update(task)
|
||||
|
Reference in New Issue
Block a user