feat: load all projects earlier than in the navigation and use the loading state of the store
continuous-integration/drone/pr Build is failing Details

This commit is contained in:
kolaente 2023-04-02 14:52:28 +02:00
parent 1fd14224b8
commit 3904626529
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
3 changed files with 9 additions and 9 deletions

View File

@ -15,8 +15,6 @@ import ProjectsNavigation from '@/components/home/ProjectsNavigation.vue'
const projectStore = useProjectStore()
await projectStore.loadProjects()
const projects = computed(() => projectStore.notArchivedRootProjects
.sort((a, b) => a.position - b.position))
const favoriteProjects = computed(() => projectStore.favoriteProjects

View File

@ -69,6 +69,7 @@ import BaseButton from '@/components/base/BaseButton.vue'
import {useBaseStore} from '@/stores/base'
import {useLabelStore} from '@/stores/labels'
import {useProjectStore} from '@/stores/projects'
import {useRouteWithModal} from '@/composables/useRouteWithModal'
import {useRenewTokenOnFocus} from '@/composables/useRenewTokenOnFocus'
@ -115,6 +116,9 @@ useRenewTokenOnFocus()
const labelStore = useLabelStore()
labelStore.loadAllLabels()
const projectStore = useProjectStore()
projectStore.loadProjects()
</script>
<style lang="scss" scoped>

View File

@ -48,13 +48,8 @@
</ul>
</nav>
<Suspense>
<ProjectsNavigationWrapper/>
<template #fallback>
<Loading variant="small"/>
</template>
</Suspense>
<Loading variant="small" v-if="projectsLoading"/>
<ProjectsNavigationWrapper v-else/>
<PoweredByLink/>
</aside>
@ -68,10 +63,13 @@ import Logo from '@/components/home/Logo.vue'
import Loading from '@/components/misc/loading.vue'
import {useBaseStore} from '@/stores/base'
import {useProjectStore} from '@/stores/projects'
import ProjectsNavigationWrapper from '@/components/home/ProjectsNavigationWrapper.vue'
const baseStore = useBaseStore()
const projectStore = useProjectStore()
const menuActive = computed(() => baseStore.menuActive)
const projectsLoading = computed(() => projectStore.isLoading)
</script>
<style lang="scss" scoped>