From 3627661e1f5013a6a753950ab116e27deba7daf1 Mon Sep 17 00:00:00 2001 From: Official Noob <31563761+OfficialNoob@users.noreply.github.com> Date: Mon, 6 Jan 2020 21:11:37 +0000 Subject: [PATCH] Backwards compatibility --- SB.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/SB.js b/SB.js index da91cea3..aed6ad91 100644 --- a/SB.js +++ b/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(); }