logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe
commit: c626f84336b08caefe72c9b74957a6c9e146d1f4
parent: ebc6a75d30bd96134c06f2ba5789ba86f03797c5
Author: lambda <lain@soykaf.club>
Date:   Fri, 15 Mar 2019 13:03:19 +0000

Merge branch 'afterstore-refactor' into 'develop'

afterStoreSetup: Move log in and theme load to afterStoreSetup.

See merge request pleroma/pleroma-fe!680

Diffstat:

Msrc/boot/after_store.js10++++++++++
Msrc/lib/persisted_state.js12------------
2 files changed, 10 insertions(+), 12 deletions(-)

diff --git 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 @@ -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")