mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-09 13:07:05 +03:00
Fixed old sponsortime config being broken.
This commit is contained in:
6
SB.js
6
SB.js
@@ -131,7 +131,7 @@ function migrateOldFormats() { // Convert sponsorTimes format
|
|||||||
for (key in SB.localConfig) {
|
for (key in SB.localConfig) {
|
||||||
if (key.startsWith("sponsorTimes") && key !== "sponsorTimes" && key !== "sponsorTimesContributed") {
|
if (key.startsWith("sponsorTimes") && key !== "sponsorTimes" && key !== "sponsorTimesContributed") {
|
||||||
SB.config.sponsorTimes.set(key.substr(12), SB.config[key]);
|
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
|
// Add defaults
|
||||||
function addDefaults() {
|
function addDefaults() {
|
||||||
Object.keys(SB.defaults).forEach(key => {
|
for (const key in SB.defaults) {
|
||||||
if(!SB.localConfig.hasOwnProperty(key)) {
|
if(!SB.localConfig.hasOwnProperty(key)) {
|
||||||
SB.localConfig[key] = SB.defaults[key];
|
SB.localConfig[key] = SB.defaults[key];
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Sync config
|
// Sync config
|
||||||
|
|||||||
Reference in New Issue
Block a user