Skip to content
Snippets Groups Projects
Commit c626f843 authored by lain's avatar lain
Browse files

Merge branch 'afterstore-refactor' into 'develop'

afterStoreSetup: Move log in and theme load to afterStoreSetup.

See merge request !680
parents ebc6a75d 5318227c
No related branches found
No related tags found
2 merge requests!1028`master` refresh with `develop`,!680afterStoreSetup: Move log in and theme load to afterStoreSetup.
Pipeline #9008 passed
......@@ -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 })
......
......@@ -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")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment