fix: sort in store
continuous-integration/drone/pr Build is failing Details

This commit is contained in:
kolaente 2023-04-14 17:21:28 +02:00
parent c2e9a11d52
commit d27ce77c95
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 4 additions and 5 deletions

View File

@ -85,10 +85,8 @@ import ProjectsNavigation from '@/components/home/ProjectsNavigation.vue'
const baseStore = useBaseStore()
const projectStore = useProjectStore()
const projects = computed(() => projectStore.notArchivedRootProjects
.sort((a, b) => a.position - b.position))
const favoriteProjects = computed(() => projectStore.favoriteProjects
.sort((a, b) => a.position - b.position))
const projects = computed(() => projectStore.notArchivedRootProjects)
const favoriteProjects = computed(() => projectStore.favoriteProjects)
</script>
<style lang="scss" scoped>

View File

@ -32,7 +32,8 @@ 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 projectsArray = computed(() => Object.values(projects.value)
.sort((a, b) => a.position - b.position))
const notArchivedRootProjects = computed(() => projectsArray.value
.filter(p => p.parentProjectId === 0 && !p.isArchived))
const favoriteProjects = computed(() => projectsArray.value