mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: closes #11511, reset skin if it was removed from bootswatch
This commit is contained in:
17
src/upgrades/3.0.0/reset_bootswatch_skin.js
Normal file
17
src/upgrades/3.0.0/reset_bootswatch_skin.js
Normal file
@@ -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', '');
|
||||
}
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user