diff options
| author | Shpuld Shpludson <shp@cock.li> | 2018-12-13 14:42:58 +0000 |
|---|---|---|
| committer | Shpuld Shpludson <shp@cock.li> | 2018-12-13 14:42:58 +0000 |
| commit | dbe79a3c2673b9a14bd8f3b037eca5999dd6a018 (patch) | |
| tree | dc01a9b95e98e8268b913ab209adffcece43a135 /src | |
| parent | c824d2537884fb736ce7fe1263875b87d3c00c81 (diff) | |
| parent | c54eb1ecad33c4e45868ca35bcaa5404a1bfd0cd (diff) | |
Merge branch 'dev-qol' into 'develop'
Several fixes to make life of contributors a tiny bit easier.
See merge request pleroma/pleroma-fe!409
Diffstat (limited to 'src')
| -rw-r--r-- | src/boot/after_store.js | 11 | ||||
| -rw-r--r-- | src/main.js | 6 |
2 files changed, 16 insertions, 1 deletions
diff --git a/src/boot/after_store.js b/src/boot/after_store.js index 0d1cabd5..07337595 100644 --- a/src/boot/after_store.js +++ b/src/boot/after_store.js @@ -42,8 +42,17 @@ const afterStoreSetup = ({ store, i18n }) => { return {} }) .then((staticConfig) => { + const overrides = window.___pleromafe_dev_overrides || {} + const env = window.___pleromafe_mode.NODE_ENV + // This takes static config and overrides properties that are present in apiConfig - var config = Object.assign({}, staticConfig, apiConfig) + let config = {} + if (overrides.staticConfigPreference && env === 'development') { + console.warn('OVERRIDING API CONFIG WITH STATIC CONFIG') + config = Object.assign({}, apiConfig, staticConfig) + } else { + config = Object.assign({}, staticConfig, apiConfig) + } var theme = (config.theme) var background = (config.background) diff --git a/src/main.js b/src/main.js index 23ea854b..bf92e78e 100644 --- a/src/main.js +++ b/src/main.js @@ -95,3 +95,9 @@ createPersistedState(persistedStateOptions).then((persistedState) => { afterStoreSetup({ store, i18n }) }) + +// These are inlined by webpack's DefinePlugin +/* eslint-disable */ +window.___pleromafe_mode = process.env +window.___pleromafe_commit_hash = COMMIT_HASH +window.___pleromafe_dev_overrides = DEV_OVERRIDES |
