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.
|
// The projects are stored as an object which has the project ids as keys.
|
||||||
const projects = ref<ProjectState>({})
|
const projects = ref<ProjectState>({})
|
||||||
const projectsArray = computed(() => Object.values(projects.value))
|
const projectsArray = computed(() => Object.values(projects.value))
|
||||||
|
const hasProjects = computed(() => projects.value ? true : false)
|
||||||
|
|
||||||
const getProjectById = computed(() => {
|
const getProjectById = computed(() => {
|
||||||
return (id: IProject['id']) => typeof projects.value[id] !== 'undefined' ? projects.value[id] : null
|
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),
|
isLoading: readonly(isLoading),
|
||||||
projects: readonly(projects),
|
projects: readonly(projects),
|
||||||
projectsArray: readonly(projectsArray),
|
projectsArray: readonly(projectsArray),
|
||||||
|
hasProjects: readonly(hasProjects),
|
||||||
|
|
||||||
getProjectById,
|
getProjectById,
|
||||||
findProjectByExactname,
|
findProjectByExactname,
|
||||||
|
|
|
@ -80,7 +80,7 @@ const projectHistory = computed(() => {
|
||||||
|
|
||||||
const migratorsEnabled = computed(() => configStore.availableMigrators?.length > 0)
|
const migratorsEnabled = computed(() => configStore.availableMigrators?.length > 0)
|
||||||
const hasTasks = computed(() => baseStore.hasTasks)
|
const hasTasks = computed(() => baseStore.hasTasks)
|
||||||
const hasProjects = computed(() => projectStore.projects ? true : false)
|
const hasProjects = computed(() => projectStore.hasProjects)
|
||||||
const loading = computed(() => taskStore.isLoading)
|
const loading = computed(() => taskStore.isLoading)
|
||||||
const deletionScheduledAt = computed(() => parseDateOrNull(authStore.info?.deletionScheduledAt))
|
const deletionScheduledAt = computed(() => parseDateOrNull(authStore.info?.deletionScheduledAt))
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user