feat(projects): move hasProjects check to store
continuous-integration/drone/pr Build is failing Details

This commit is contained in:
kolaente 2023-03-28 16:27:07 +02:00
parent b1cb26d423
commit ebb239f683
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 3 additions and 1 deletions

View File

@ -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,

View File

@ -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))