fix: make sure the app is fully ready before trying to redirect to the login page #1337
|
@ -60,7 +60,7 @@ const route = useRoute()
|
|||
|
||||
const store = useStore()
|
||||
|
||||
const ready = computed(() => store.state.vikunjaReady)
|
||||
const ready = ref(false)
|
||||
const online = useOnline()
|
||||
|
||||
const error = ref('')
|
||||
|
@ -73,7 +73,7 @@ async function load() {
|
|||
if (typeof redirectTo !== 'undefined') {
|
||||
await router.push(redirectTo)
|
||||
dpschen marked this conversation as resolved
|
||||
}
|
||||
store.commit('vikunjaReady', true)
|
||||
ready.value = true
|
||||
} catch (e: any) {
|
||||
error.value = e
|
||||
}
|
||||
|
|
|
@ -43,7 +43,6 @@ export const store = createStore({
|
|||
menuActive: true,
|
||||
keyboardShortcutsActive: false,
|
||||
quickActionsActive: false,
|
||||
vikunjaReady: false,
|
||||
},
|
||||
mutations: {
|
||||
[LOADING](state, loading) {
|
||||
|
@ -79,9 +78,6 @@ export const store = createStore({
|
|||
[BACKGROUND](state, background) {
|
||||
state.background = background
|
||||
},
|
||||
vikunjaReady(state, ready) {
|
||||
state.vikunjaReady = ready
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
async [CURRENT_LIST]({state, commit}, currentList) {
|
||||
|
|
Reference in New Issue
I wanted to make sure the app would only be ready after it was redirected. What bothers me here is I had to move the
store.commit('vikunjaReady', true)
out of theloadApp
action. It should be fine since this is the only place where that action is used, but I'm not quite sure about it.Can you give a bit more context what you mean by:
That was meant the other way around - "...make sure the app would only redirect after it was ready"
See my lenghty comment below.
Ahh that makes more sense. I really broke my mind on this one :D