mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 18:41:47 +00:00
29 lines
595 B
JavaScript
29 lines
595 B
JavaScript
const { dialog } = require("electron");
|
|
const Store = require("electron-store");
|
|
|
|
const defaults = require("./defaults");
|
|
|
|
const migrations = {
|
|
">=1.7.0": (store) => {
|
|
const enabledPlugins = store.get("plugins");
|
|
if (!Array.isArray(enabledPlugins)) {
|
|
console.warn("Plugins are not in array format, cannot migrate");
|
|
return;
|
|
}
|
|
|
|
const plugins = {};
|
|
enabledPlugins.forEach((enabledPlugin) => {
|
|
plugins[enabledPlugin] = {
|
|
enabled: true,
|
|
};
|
|
});
|
|
store.set("plugins", plugins);
|
|
},
|
|
};
|
|
|
|
module.exports = new Store({
|
|
defaults,
|
|
clearInvalidConfig: false,
|
|
migrations,
|
|
});
|