diff --git a/src/App.vue b/src/App.vue index dec28560a..2f91fda2e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,5 +1,5 @@ + + diff --git a/src/i18n/lang/en.json b/src/i18n/lang/en.json index 3d684db7e..79886d36b 100644 --- a/src/i18n/lang/en.json +++ b/src/i18n/lang/en.json @@ -1,5 +1,6 @@ { "home": { + "vikunjaLoading": "Vikunja is loading…", "welcomeNight": "Good Night {username}", "welcomeMorning": "Good Morning {username}", "welcomeDay": "Hi {username}", diff --git a/src/store/index.js b/src/store/index.js index c60e0ebf9..79c7d0177 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -43,6 +43,7 @@ export const store = createStore({ menuActive: true, keyboardShortcutsActive: false, quickActionsActive: false, + vikunjaReady: false, }, mutations: { [LOADING](state, loading) { @@ -84,6 +85,9 @@ export const store = createStore({ [BACKGROUND](state, background) { state.background = background }, + vikunjaReady(state, ready) { + state.vikunjaReady = ready + } }, actions: { async [CURRENT_LIST]({state, commit}, currentList) { @@ -138,5 +142,10 @@ export const store = createStore({ commit(CURRENT_LIST, currentList) }, + async loadApp({commit, dispatch}) { + await dispatch('config/update') + await dispatch('auth/checkAuth') + commit('vikunjaReady', true) + }, }, }) diff --git a/src/styles/theme/loading.scss b/src/styles/theme/loading.scss index a4a76a4c4..687e7c0e6 100644 --- a/src/styles/theme/loading.scss +++ b/src/styles/theme/loading.scss @@ -1,17 +1,27 @@ // FIXME: move to loading.vue -.loader-container.is-loading { - position: relative; - pointer-events: none; - opacity: 0.5; +.loader-container { + &.is-loading { + position: relative; + pointer-events: none; + opacity: 0.5; - &::after { - @include loader; - position: absolute; - top: calc(50% - 2.5rem); - left: calc(50% - 2.5rem); - width: 5rem; - height: 5rem; - border-width: 0.25rem; + &::after { + @include loader; + position: absolute; + top: calc(50% - 2.5rem); + left: calc(50% - 2.5rem); + width: 5rem; + height: 5rem; + border-width: 0.25rem; + } + } + + &.is-loading-small.is-loading::after { + width: 1.5rem; + height: 1.5rem; + top: calc(50% - .75rem); + left: calc(50% - .75rem); + border-width: 2px; } }