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
continuous-integration/drone/pr Build is failing
Details
This commit is contained in:
parent
00aa05206d
commit
071daabe19
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue