Checks improved

This commit is contained in:
nobody 2021-02-07 09:54:18 +01:00
parent 25638f8a44
commit 6655c8cd98
No known key found for this signature in database
GPG Key ID: 8F6DE3D614FCFD7A
2 changed files with 5 additions and 5 deletions

View File

@ -33,8 +33,8 @@ main._initializeSettings = function () {
storageManager.type.get(null, function (items) {
// Delete old keys
if (typeof items.whitelistedDomains !== 'undefined') {
if (typeof items.allowlistedDomains === 'undefined' || Object.keys(items.allowlistedDomains).length === 0) {
if (items.whitelistedDomains !== undefined) {
if (items.allowlistedDomains === undefined || Object.keys(items.allowlistedDomains).length === 0) {
items['allowlistedDomains'] = items.whitelistedDomains;
}
delete items['whitelistedDomains'];
@ -42,7 +42,7 @@ main._initializeSettings = function () {
}
// Convert value of notifications
if (typeof items.hideReleaseNotes !== 'undefined') {
if (items.hideReleaseNotes !== undefined) {
if (items.hideReleaseNotes === true) {
items.updateNotification = 0;
} else {

View File

@ -137,13 +137,13 @@ storageManager._validation = function (content) {
let imported = {};
// Delete old keys
if (typeof content.whitelistedDomains !== 'undefined') {
if (content.whitelistedDomains !== undefined) {
content.allowlistedDomains = content.whitelistedDomains;
delete content['whitelistedDomains'];
}
// Convert value of notifications
if (typeof content.hideReleaseNotes !== 'undefined') {
if (content.hideReleaseNotes !== undefined) {
content.updateNotification = content.hideReleaseNotes ? 0 : 2;
delete content['hideReleaseNotes'];
}