Consolidate UI configuration in one place, allowing it to be overridden from the server

This commit is contained in:
Deluan
2020-04-07 16:58:02 -04:00
committed by Deluan Quintão
parent d0188db4f9
commit a0f389fc3e
4 changed files with 28 additions and 4 deletions
+20
View File
@@ -0,0 +1,20 @@
const defaultConfig = {
firstTime: false,
baseURL: '',
loginBackgroundURL: 'https://source.unsplash.com/random/1600x900?music'
}
let config
try {
const appConfig = JSON.parse(window.__APP_CONFIG__)
config = {
...defaultConfig,
...appConfig
}
} catch (e) {
config = defaultConfig
}
export default config