Fix format conflict

This commit is contained in:
Official Noob 2020-01-06 23:12:48 +00:00 committed by GitHub
parent c20b67d11f
commit a7dc207c5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

4
SB.js
View file

@ -28,7 +28,7 @@ fetchConfig = () => new Promise((resolve, reject) => {
function migrate() { // Convert sponsorTimes format function migrate() { // Convert sponsorTimes format
for (key in SB.localconfig) { for (key in SB.localconfig) {
if (key.startsWith("sponsorTimes") && key !== "sponsorTimes") { 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]; delete SB.config[key];
} }
@ -38,8 +38,8 @@ function migrate() { // Convert sponsorTimes format
async function config() { async function config() {
await fetchConfig(); await fetchConfig();
addDefaults(); addDefaults();
migrate();
SB.config = configProxy(); SB.config = configProxy();
migrate();
} }
SB.defaults = { SB.defaults = {