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:
kolaente
2026-02-24 13:13:30 +01:00
parent f7a93e4ca3
commit 7c04d44e2e

View File

@@ -11,6 +11,7 @@ import {checkAndSetApiUrl, ERROR_NO_API_URL, InvalidApiUrlProvidedError, NoApiUr
import {useMenuActive} from '@/composables/useMenuActive'
import {useAuthStore} from '@/stores/auth'
import router from '@/router'
import type {IProject} from '@/modelTypes/IProject'
import type {Permission} from '@/constants/permissions'
import type {IProjectView} from '@/modelTypes/IProjectView'
@@ -147,6 +148,7 @@ export const useBaseStore = defineStore('base', () => {
try {
await checkAndSetApiUrl(window.API_URL)
await authStore.checkAuth()
await router.isReady()
ready.value = true
} catch (e: unknown) {
if (e instanceof NoApiUrlProvidedError) {