diff options
| author | marcin mikołajczak <git@mkljczk.pl> | 2024-10-03 21:52:44 +0200 |
|---|---|---|
| committer | marcin mikołajczak <git@mkljczk.pl> | 2024-10-03 21:52:44 +0200 |
| commit | 216ca52073212942ffb6f75b63993a5f5c32a5d6 (patch) | |
| tree | e67dca18d5f0343ae798e60bfec7d7969e54856f /src/boot/after_store.js | |
| parent | a5689464d0829ae038fbba72f3ab96afd917bd8d (diff) | |
| parent | a1c3a7a742ea86b0ddeb67a42ca27f478f0f22a2 (diff) | |
Merge remote-tracking branch 'origin/develop' into bookmark-folders
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
Diffstat (limited to 'src/boot/after_store.js')
| -rw-r--r-- | src/boot/after_store.js | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/boot/after_store.js b/src/boot/after_store.js index 5b610dd3..9a6964d1 100644 --- a/src/boot/after_store.js +++ b/src/boot/after_store.js @@ -328,11 +328,7 @@ const setConfig = async ({ store }) => { const checkOAuthToken = async ({ store }) => { if (store.getters.getUserToken()) { - try { - await store.dispatch('loginUser', store.getters.getUserToken()) - } catch (e) { - console.error(e) - } + return store.dispatch('loginUser', store.getters.getUserToken()) } return Promise.resolve() } @@ -350,19 +346,26 @@ const afterStoreSetup = async ({ store, i18n }) => { const server = (typeof overrides.target !== 'undefined') ? overrides.target : window.location.origin store.dispatch('setInstanceOption', { name: 'server', value: server }) + document.querySelector('#status').textContent = i18n.global.t('splash.settings') await setConfig({ store }) - await store.dispatch('setTheme') + document.querySelector('#status').textContent = i18n.global.t('splash.theme') + try { + await store.dispatch('setTheme').catch((e) => { console.error('Error setting theme', e) }) + } catch (e) { + return Promise.reject(e) + } - applyConfig(store.state.config) + applyConfig(store.state.config, i18n.global) // Now we can try getting the server settings and logging in // Most of these are preloaded into the index.html so blocking is minimized + document.querySelector('#status').textContent = i18n.global.t('splash.instance') await Promise.all([ checkOAuthToken({ store }), getInstancePanel({ store }), getNodeInfo({ store }), getInstanceConfig({ store }) - ]) + ]).catch(e => Promise.reject(e)) // Start fetching things that don't need to block the UI store.dispatch('fetchMutes') @@ -396,9 +399,9 @@ const afterStoreSetup = async ({ store, i18n }) => { // remove after vue 3.3 app.config.unwrapInjectedRef = true + document.querySelector('#status').textContent = i18n.global.t('splash.almost') app.mount('#app') - return app } |
