fix: wait for router before dismissing loading screen
The loading screen was dismissed as soon as auth check completed, but before Vue Router's initial navigation finished. This caused route.name to be undefined momentarily, making showAuthLayout evaluate to false and briefly flashing the NoAuthWrapper (login shell) before the authenticated layout appeared. Wait for router.isReady() before setting ready = true so the loading screen stays visible until the route is fully resolved.
This commit is contained in:
parent
f7a93e4ca3
commit
7c04d44e2e
|
|
@ -11,6 +11,7 @@ import {checkAndSetApiUrl, ERROR_NO_API_URL, InvalidApiUrlProvidedError, NoApiUr
|
||||||
import {useMenuActive} from '@/composables/useMenuActive'
|
import {useMenuActive} from '@/composables/useMenuActive'
|
||||||
|
|
||||||
import {useAuthStore} from '@/stores/auth'
|
import {useAuthStore} from '@/stores/auth'
|
||||||
|
import router from '@/router'
|
||||||
import type {IProject} from '@/modelTypes/IProject'
|
import type {IProject} from '@/modelTypes/IProject'
|
||||||
import type {Permission} from '@/constants/permissions'
|
import type {Permission} from '@/constants/permissions'
|
||||||
import type {IProjectView} from '@/modelTypes/IProjectView'
|
import type {IProjectView} from '@/modelTypes/IProjectView'
|
||||||
|
|
@ -147,6 +148,7 @@ export const useBaseStore = defineStore('base', () => {
|
||||||
try {
|
try {
|
||||||
await checkAndSetApiUrl(window.API_URL)
|
await checkAndSetApiUrl(window.API_URL)
|
||||||
await authStore.checkAuth()
|
await authStore.checkAuth()
|
||||||
|
await router.isReady()
|
||||||
ready.value = true
|
ready.value = true
|
||||||
} catch (e: unknown) {
|
} catch (e: unknown) {
|
||||||
if (e instanceof NoApiUrlProvidedError) {
|
if (e instanceof NoApiUrlProvidedError) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue