From 7d7904b045c43aa7c87f10867b68b3ab54989492 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 24 Apr 2023 09:35:25 -0400 Subject: [PATCH] fix: closes #11511, reset skin if it was removed from bootswatch --- src/upgrades/3.0.0/reset_bootswatch_skin.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/upgrades/3.0.0/reset_bootswatch_skin.js diff --git a/src/upgrades/3.0.0/reset_bootswatch_skin.js b/src/upgrades/3.0.0/reset_bootswatch_skin.js new file mode 100644 index 0000000000..8c97adf7f5 --- /dev/null +++ b/src/upgrades/3.0.0/reset_bootswatch_skin.js @@ -0,0 +1,17 @@ +'use strict'; + + +const db = require('../../database'); + +module.exports = { + name: 'Reset bootswatch skin', + timestamp: Date.UTC(2023, 3, 24), + method: async function () { + const config = await db.getObject('config'); + const currentSkin = config.bootswatchSkin || ''; + const css = require('../../meta/css'); + if (currentSkin && !css.supportedSkins.includes(currentSkin)) { + await db.setObjectField('config', 'bootswatchSkin', ''); + } + }, +};