fix: move config store usage to redirect function to avoid execution during import and before pinia is initialized
continuous-integration/drone/pr Build is failing Details

This commit is contained in:
Daniel Herrmann 2024-03-03 01:05:09 +01:00
parent 00aa05206d
commit 071daabe19
1 changed files with 4 additions and 4 deletions

View File

@ -80,10 +80,6 @@ const NewProjectComponent = () => import('@/views/project/NewProject.vue')
const EditTeamComponent = () => import('@/views/teams/EditTeam.vue')
const NewTeamComponent = () => import('@/views/teams/NewTeam.vue')
// Project default view
const configStore = useConfigStore()
const defaultProjectView = computed(() => configStore.defaultProjectView)
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
scrollBehavior(to, from, savedPosition) {
@ -354,6 +350,10 @@ const router = createRouter({
redirect(to) {
// Redirect the user to list view by default
const savedProjectView = getProjectView(Number(to.params.projectId as string))
// Project default view
const configStore = useConfigStore()
const defaultProjectView = computed(() => configStore.defaultProjectView)
if (savedProjectView) {
console.log('Replaced list view with', savedProjectView)