afterStoreSetup: Move log in and theme load to afterStoreSetup.
This commit is contained in:
parent
48ac96cfc7
commit
5318227c37
2 changed files with 10 additions and 12 deletions
|
@ -212,6 +212,16 @@ const getNodeInfo = async ({ store }) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const afterStoreSetup = async ({ store, i18n }) => {
|
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 apiConfig = await getStatusnetConfig({ store })
|
||||||
const staticConfig = await getStaticConfig()
|
const staticConfig = await getStaticConfig()
|
||||||
await setSettings({ store, apiConfig, staticConfig })
|
await setSettings({ store, apiConfig, staticConfig })
|
||||||
|
|
|
@ -60,18 +60,6 @@ export default function createPersistedState ({
|
||||||
merge({}, store.state, savedState)
|
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
|
loaded = true
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log("Couldn't load state")
|
console.log("Couldn't load state")
|
||||||
|
|
Loading…
Reference in a new issue