diff options
| author | lain <lain@soykaf.club> | 2019-03-13 13:29:34 +0100 |
|---|---|---|
| committer | lain <lain@soykaf.club> | 2019-03-13 13:29:34 +0100 |
| commit | 5318227c378a9cd44baa4cc12dbb1935826c843b (patch) | |
| tree | 63b471d34fddd4da41afabfaf76ff2cbcb3e3273 | |
| parent | 48ac96cfc7c9c3328d7a18707f00a2fe1bc743a1 (diff) | |
afterStoreSetup: Move log in and theme load to afterStoreSetup.
| -rw-r--r-- | src/boot/after_store.js | 10 | ||||
| -rw-r--r-- | src/lib/persisted_state.js | 12 |
2 files changed, 10 insertions, 12 deletions
diff --git a/src/boot/after_store.js b/src/boot/after_store.js index a51f895e..3d400ffa 100644 --- a/src/boot/after_store.js +++ b/src/boot/after_store.js @@ -212,6 +212,16 @@ const getNodeInfo = async ({ store }) => { } const afterStoreSetup = async ({ store, i18n }) => { + if (store.state.config.customTheme) { + // This is a hack to deal with async loading of config.json and themes + // See: style_setter.js, setPreset() + window.themeLoaded = true + store.dispatch('setOption', { + name: 'customTheme', + value: store.state.config.customTheme + }) + } + const apiConfig = await getStatusnetConfig({ store }) const staticConfig = await getStaticConfig() await setSettings({ store, apiConfig, staticConfig }) diff --git a/src/lib/persisted_state.js b/src/lib/persisted_state.js index e828a74b..7ab89c12 100644 --- a/src/lib/persisted_state.js +++ b/src/lib/persisted_state.js @@ -60,18 +60,6 @@ export default function createPersistedState ({ merge({}, store.state, savedState) ) } - if (store.state.config.customTheme) { - // This is a hack to deal with async loading of config.json and themes - // See: style_setter.js, setPreset() - window.themeLoaded = true - store.dispatch('setOption', { - name: 'customTheme', - value: store.state.config.customTheme - }) - } - if (store.state.oauth.token) { - store.dispatch('loginUser', store.state.oauth.token) - } loaded = true } catch (e) { console.log("Couldn't load state") |
