Removed warning. Added support for working without static/config.json

This commit is contained in:
Henry Jameson 2018-09-17 18:00:56 +03:00
parent 394153380d
commit 40a175389a
2 changed files with 74 additions and 71 deletions

View File

@ -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:")

View File

@ -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)