mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-03-11 17:48:44 -05:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user