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 }) store.dispatch('settingsSaved', { error })
} }
}) })
} else {
console.warn(`Not saving to localStorage for: ${mutation.type}`)
} }
} catch (e) { } catch (e) {
console.log("Couldn't persist state:") console.log("Couldn't persist state:")

View file

@ -90,8 +90,13 @@ window.fetch('/api/statusnet/config.json')
window.fetch('/static/config.json') window.fetch('/static/config.json')
.then((res) => res.json()) .then((res) => res.json())
.then((data) => { .catch((err) => {
var staticConfig = data 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 // This takes static config and overrides properties that are present in apiConfig
var config = Object.assign({}, staticConfig, apiConfig) var config = Object.assign({}, staticConfig, apiConfig)