Skip to content

Commit

Permalink
fixed initial white screen on single user mode
Browse files Browse the repository at this point in the history
  • Loading branch information
rgaudin committed Oct 4, 2024
1 parent 2e85fbd commit a8d2015
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions frontend/src/views/SingleUserHome.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
</template>

<script setup lang="ts">
import { onMounted } from 'vue'
import { type Project } from '@/constants'
import type { User } from '@/constants'
import { useAppStore, useProjectStore } from '@/stores/stores'
Expand Down Expand Up @@ -50,11 +51,15 @@ async function retrieveProjects(): Promise<Project[]> {
return projects
}
await restrieveUser()
const projects = await retrieveProjects()
storeProject.setProjects(projects)
if (projects.length) {
storeProject.setLastProjectId(projects[projects.length - 1].id)
}
router.push('/collections')
onMounted(() => {
restrieveUser().then(() => {
retrieveProjects().then((projects) => {
storeProject.setProjects(projects)
if (projects.length) {
storeProject.setLastProjectId(projects[projects.length - 1].id)
}
router.push('/collections')
})
})
})
</script>

0 comments on commit a8d2015

Please sign in to comment.