Instantiate project store

This commit is contained in:
surfingbytes 2026-04-02 09:15:49 +00:00
parent 209507a4ea
commit 64c3cf9c92
2 changed files with 4 additions and 2 deletions

View File

@ -24,6 +24,7 @@ export function useRedirectToLastVisited() {
function getDefaultPageRoute() {
const authStore = useAuthStore()
const projectStore = useProjectStore()
const defaultPage = authStore.settings?.frontendSettings?.defaultPage
switch (defaultPage) {
@ -31,7 +32,7 @@ export function useRedirectToLastVisited() {
return {name: 'tasks.range'}
case DEFAULT_PAGE.DEFAULT_PROJECT: {
const projectId = authStore.settings?.defaultProjectId
if (projectId && useProjectStore().projects[projectId]) {
if (projectId && projectStore.projects[projectId]) {
return {name: 'project.index', params: {projectId}}
}
return {name: 'home'}

View File

@ -56,6 +56,7 @@ const router = createRouter({
sessionStorage.setItem(redirectKey, 'true')
const authStore = useAuthStore()
const projectStore = useProjectStore()
const defaultPage = authStore.settings?.frontendSettings?.defaultPage
switch (defaultPage) {
@ -65,7 +66,7 @@ const router = createRouter({
const projectId = authStore.settings?.defaultProjectId
if (projectId) {
try {
await useProjectStore().loadProject(projectId)
await projectStore.loadProject(projectId)
return {name: 'project.index', params: {projectId}}
} catch {
break