mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-06 11:37:02 +03:00
Backwards compatibility
This commit is contained in:
10
SB.js
10
SB.js
@@ -26,9 +26,19 @@ fetchConfig = () => new Promise((resolve, reject) => {
|
||||
});
|
||||
});
|
||||
|
||||
function migrate() { // Convert sponsorTimes format
|
||||
for (key in SB.localconfig) {
|
||||
if (key.startsWith("sponsortime")) {
|
||||
SB.config.sponsorTimes.set(key.substr(12), SB.config[key]);
|
||||
delete SB.config[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function config() {
|
||||
await fetchConfig();
|
||||
addDefaults();
|
||||
migrate();
|
||||
SB.config = configProxy();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user