Merge branch 'fix/app-ready' into feature/vue3-modals-with-router-4
This commit is contained in:
@ -53,14 +53,14 @@ import {ERROR_NO_API_URL} from '@/helpers/checkAndSetApiUrl'
|
||||
import {useOnline} from '@/composables/useOnline'
|
||||
|
||||
import {useRouter, useRoute} from 'vue-router'
|
||||
import {checkAuth} from '@/router'
|
||||
import {getAuthForRoute} from '@/router'
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
|
||||
const store = useStore()
|
||||
|
||||
const ready = computed(() => store.state.vikunjaReady)
|
||||
const ready = ref(false)
|
||||
const online = useOnline()
|
||||
|
||||
const error = ref('')
|
||||
@ -69,11 +69,11 @@ const showLoading = computed(() => !ready.value && error.value === '')
|
||||
async function load() {
|
||||
try {
|
||||
await store.dispatch('loadApp')
|
||||
const redirectTo = checkAuth(route)
|
||||
const redirectTo = getAuthForRoute(route)
|
||||
if (typeof redirectTo !== 'undefined') {
|
||||
await router.push(redirectTo)
|
||||
}
|
||||
store.commit('vikunjaReady', true)
|
||||
ready.value = true
|
||||
} catch (e: any) {
|
||||
error.value = e
|
||||
}
|
||||
|
Reference in New Issue
Block a user