Move migrations into separate const

This commit is contained in:
TC
2020-12-03 18:25:08 +01:00
parent 8ab2da0482
commit a5130c1d3f

View File

@ -3,10 +3,7 @@ const Store = require("electron-store");
const defaults = require("./defaults");
module.exports = new Store({
defaults,
clearInvalidConfig: false,
migrations: {
const migrations = {
">=1.7.0": (store) => {
const enabledPlugins = store.get("plugins");
if (!Array.isArray(enabledPlugins)) {
@ -22,5 +19,10 @@ module.exports = new Store({
});
store.set("plugins", plugins);
},
},
};
module.exports = new Store({
defaults,
clearInvalidConfig: false,
migrations,
});