chore: export favorite projects from store
This commit is contained in:
parent
336db56316
commit
131022da42
@ -24,8 +24,7 @@ const projects = computed({
|
||||
},
|
||||
set() { }, // Vue will complain about the component not being writable - but we never need to write here. The setter is only here to silence the warning.
|
||||
})
|
||||
const favoriteProjects = computed(() => projectStore.projectsArray
|
||||
.filter(p => !p.isArchived && p.isFavorite)
|
||||
const favoriteProjects = computed(() => projectStore.favoriteProjects
|
||||
.sort((a, b) => a.position - b.position))
|
||||
</script>
|
||||
|
||||
|
@ -31,6 +31,8 @@ export const useProjectStore = defineStore('project', () => {
|
||||
const projectsArray = computed(() => Object.values(projects.value))
|
||||
const notArchivedRootProjects = computed(() => projectsArray.value
|
||||
.filter(p => p.parentProjectId === 0 && !p.isArchived))
|
||||
const favoriteProjects = computed(() => projectsArray.value
|
||||
.filter(p => !p.isArchived && p.isFavorite))
|
||||
const hasProjects = computed(() => projects.value ? true : false)
|
||||
|
||||
const getProjectById = computed(() => {
|
||||
@ -203,6 +205,7 @@ export const useProjectStore = defineStore('project', () => {
|
||||
projects: readonly(projects),
|
||||
projectsArray: readonly(projectsArray),
|
||||
notArchivedRootProjects: readonly(notArchivedRootProjects),
|
||||
favoriteProjects: readonly(favoriteProjects),
|
||||
hasProjects: readonly(hasProjects),
|
||||
|
||||
getProjectById,
|
||||
|
Loading…
x
Reference in New Issue
Block a user