make sure defaults are available if missing from localStorage

fixes #277
This commit is contained in:
Jason Kulatunga
2022-06-04 08:08:45 -07:00
parent ca7772250c
commit d9ecf6c0d3
@@ -19,11 +19,11 @@ export class TreoConfigService
{
let currentScrutinyConfig = defaultConfig
let localConfigStr = localStorage.getItem(SCRUTINY_CONFIG_LOCAL_STORAGE_KEY)
const localConfigStr = localStorage.getItem(SCRUTINY_CONFIG_LOCAL_STORAGE_KEY)
if(localConfigStr){
//check localstorage for a value
let localConfig = JSON.parse(localConfigStr)
currentScrutinyConfig = localConfig
// check localstorage for a value
const localConfig = JSON.parse(localConfigStr)
currentScrutinyConfig = Object.assign({}, localConfig, currentScrutinyConfig) // make sure defaults are available if missing from localStorage.
}
// Set the private defaults