diff --git a/src/components/misc/ready.vue b/src/components/misc/ready.vue index fd5fe92d8..8fd3f4fd3 100644 --- a/src/components/misc/ready.vue +++ b/src/components/misc/ready.vue @@ -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 } diff --git a/src/router/index.ts b/src/router/index.ts index a38e80db7..5a2d8f975 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -429,7 +429,7 @@ const router = createRouter({ ], }) -export function checkAuth(route: RouteLocation) { +export function getAuthForRoute(route: RouteLocation) { const authUser = store.getters['auth/authUser'] const authLinkShare = store.getters['auth/authLinkShare'] diff --git a/src/store/index.js b/src/store/index.js index 2890d7f3b..0833e3f63 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -48,7 +48,6 @@ export const store = createStore({ menuActive: true, keyboardShortcutsActive: false, quickActionsActive: false, - vikunjaReady: false, }, mutations: { [LOADING](state, loading) { @@ -84,9 +83,6 @@ export const store = createStore({ [BACKGROUND](state, background) { state.background = background }, - vikunjaReady(state, ready) { - state.vikunjaReady = ready - }, }, actions: { async [CURRENT_LIST]({state, commit}, currentList) {