feat(projects): move hasProjects check to store
This commit is contained in:
parent
2579c33ee1
commit
a95014dc5d
@ -29,6 +29,7 @@ export const useProjectStore = defineStore('project', () => {
|
||||
// The projects are stored as an object which has the project ids as keys.
|
||||
const projects = ref<ProjectState>({})
|
||||
const projectsArray = computed(() => Object.values(projects.value))
|
||||
const hasProjects = computed(() => projects.value ? true : false)
|
||||
|
||||
const getProjectById = computed(() => {
|
||||
return (id: IProject['id']) => typeof projects.value[id] !== 'undefined' ? projects.value[id] : null
|
||||
@ -181,6 +182,7 @@ export const useProjectStore = defineStore('project', () => {
|
||||
isLoading: readonly(isLoading),
|
||||
projects: readonly(projects),
|
||||
projectsArray: readonly(projectsArray),
|
||||
hasProjects: readonly(hasProjects),
|
||||
|
||||
getProjectById,
|
||||
findProjectByExactname,
|
||||
|
@ -80,7 +80,7 @@ const projectHistory = computed(() => {
|
||||
|
||||
const migratorsEnabled = computed(() => configStore.availableMigrators?.length > 0)
|
||||
const hasTasks = computed(() => baseStore.hasTasks)
|
||||
const hasProjects = computed(() => projectStore.projects ? true : false)
|
||||
const hasProjects = computed(() => projectStore.hasProjects)
|
||||
const loading = computed(() => taskStore.isLoading)
|
||||
const deletionScheduledAt = computed(() => parseDateOrNull(authStore.info?.deletionScheduledAt))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user