Backwards compatibility

This commit is contained in:
Official Noob
2020-01-06 21:11:37 +00:00
committed by GitHub
parent f1c68a98cf
commit 3627661e1f

10
SB.js
View File

@@ -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() { async function config() {
await fetchConfig(); await fetchConfig();
addDefaults(); addDefaults();
migrate();
SB.config = configProxy(); SB.config = configProxy();
} }