forked from srxl/akkoma-fe
Removed warning. Added support for working without static/config.json
This commit is contained in:
parent
394153380d
commit
40a175389a
2 changed files with 74 additions and 71 deletions
|
@ -92,8 +92,6 @@ export default function createPersistedState ({
|
|||
store.dispatch('settingsSaved', { error })
|
||||
}
|
||||
})
|
||||
} else {
|
||||
console.warn(`Not saving to localStorage for: ${mutation.type}`)
|
||||
}
|
||||
} catch (e) {
|
||||
console.log("Couldn't persist state:")
|
||||
|
|
|
@ -90,8 +90,13 @@ window.fetch('/api/statusnet/config.json')
|
|||
|
||||
window.fetch('/static/config.json')
|
||||
.then((res) => res.json())
|
||||
.then((data) => {
|
||||
var staticConfig = data
|
||||
.catch((err) => {
|
||||
console.warn('Failed to load static/config.json, continuing without it.')
|
||||
console.warn('Error was: ')
|
||||
console.warn(err)
|
||||
return {}
|
||||
})
|
||||
.then((staticConfig) => {
|
||||
// This takes static config and overrides properties that are present in apiConfig
|
||||
var config = Object.assign({}, staticConfig, apiConfig)
|
||||
|
||||
|
|
Loading…
Reference in a new issue