1
0

fix(task): only show create list or import cta when there are no tasks

This commit is contained in:
kolaente
2022-10-23 14:01:20 +02:00
parent d7048d589e
commit 7e218e03b2
2 changed files with 22 additions and 0 deletions

View File

@ -28,6 +28,7 @@ import {useLabelStore} from '@/stores/labels'
import {useListStore} from '@/stores/lists'
import {useAttachmentStore} from '@/stores/attachments'
import {useKanbanStore} from '@/stores/kanban'
import {useBaseStore} from '@/stores/base'
// IDEA: maybe use a small fuzzy search here to prevent errors
function findPropertyByValue(object, key, value) {
@ -105,6 +106,7 @@ export const useTaskStore = defineStore('task', {
const cancel = setModuleLoading(this)
try {
this.tasks = await taskService.getAll({}, params)
useBaseStore().setHasTasks(this.tasks.length > 0)
return this.tasks
} finally {
cancel()