make sure defaults are available if missing from localStorage

fixes #277
pull/276/head^2
Jason Kulatunga 2 years ago
parent ca7772250c
commit d9ecf6c0d3

@ -19,11 +19,11 @@ export class TreoConfigService
{ {
let currentScrutinyConfig = defaultConfig let currentScrutinyConfig = defaultConfig
let localConfigStr = localStorage.getItem(SCRUTINY_CONFIG_LOCAL_STORAGE_KEY) const localConfigStr = localStorage.getItem(SCRUTINY_CONFIG_LOCAL_STORAGE_KEY)
if(localConfigStr){ if(localConfigStr){
// check localstorage for a value // check localstorage for a value
let localConfig = JSON.parse(localConfigStr) const localConfig = JSON.parse(localConfigStr)
currentScrutinyConfig = localConfig currentScrutinyConfig = Object.assign({}, localConfig, currentScrutinyConfig) // make sure defaults are available if missing from localStorage.
} }
// Set the private defaults // Set the private defaults

Loading…
Cancel
Save