From aee0712ef1f57ed82f1907d0e865a7e70be7c46b Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Sat, 11 Jan 2020 13:27:20 -0500 Subject: [PATCH] Fixed old sponsortime config being broken. --- SB.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SB.js b/SB.js index a7f8d048..ef624dc7 100644 --- a/SB.js +++ b/SB.js @@ -131,7 +131,7 @@ function migrateOldFormats() { // Convert sponsorTimes format for (key in SB.localConfig) { if (key.startsWith("sponsorTimes") && key !== "sponsorTimes" && key !== "sponsorTimesContributed") { SB.config.sponsorTimes.set(key.substr(12), SB.config[key]); - delete SB.config[key]; + chrome.storage.sync.remove(key); } } } @@ -178,11 +178,11 @@ function convertJSON() { // Add defaults function addDefaults() { - Object.keys(SB.defaults).forEach(key => { - if(!SB.localConfig.hasOwnProperty(key)) { + for (const key in SB.defaults) { + if(!SB.localConfig.hasOwnProperty(key)) { SB.localConfig[key] = SB.defaults[key]; } - }); + } }; // Sync config