Fixed settings upgrader

This commit is contained in:
Hygna 2022-10-23 13:23:05 +01:00
parent eb3794cdcb
commit 0baaf7ed82
No known key found for this signature in database
3 changed files with 5 additions and 3 deletions

View File

@ -727,6 +727,10 @@ function upgradeOptions() {
if (r[frontend + utils.camelCase(protocol) + "RedirectsChecks"]) {
options[frontend][network].enabled = r[frontend + utils.camelCase(protocol) + "RedirectsChecks"]
options[frontend][network].custom = r[frontend + utils.camelCase(protocol) + "CustomRedirects"]
for (const instance of options[frontend][network].enabled) {
let i = r.redirects[frontend][network].indexOf(instance)
if (i < 0) options[frontend][network].enabled.splice(i, 1)
}
}
}
}

View File

@ -31,7 +31,6 @@ browser.runtime.onInstalled.addListener(details => {
await generalHelper.initDefaults()
await servicesHelper.initDefaults()
await servicesHelper.upgradeOptions()
await servicesHelper.processEnabledInstanceList()
}
})
break

View File

@ -77,7 +77,6 @@ importSettingsElement.addEventListener("change", () => {
await generalHelper.initDefaults()
await servicesHelper.initDefaults()
await servicesHelper.upgradeOptions()
await servicesHelper.processEnabledInstanceList()
location.reload()
})
})
@ -87,7 +86,7 @@ importSettingsElement.addEventListener("change", () => {
let options = data
delete options.version
browser.storage.local.set({ options: data }, async () => {
await servicesHelper.processEnabledInstanceList()
await servicesHelper.processUpdate()
location.reload()
})
} else {