diff options
author | Ajay Ramachandran <[email protected]> | 2020-01-11 13:27:20 -0500 |
---|---|---|
committer | Ajay Ramachandran <[email protected]> | 2020-01-11 13:27:20 -0500 |
commit | aee0712ef1f57ed82f1907d0e865a7e70be7c46b (patch) | |
tree | ec7bc74416bbe9c2c126c1323e6d9da4df534444 | |
parent | 63568aae9c49b4dec0d0882e2bb73360fc9e91d9 (diff) | |
download | SponsorBlock-aee0712ef1f57ed82f1907d0e865a7e70be7c46b.tar.gz SponsorBlock-aee0712ef1f57ed82f1907d0e865a7e70be7c46b.zip |
Fixed old sponsortime config being broken.
-rw-r--r-- | SB.js | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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 |