mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 18:41:47 +00:00
[notifications] use dynamic config
This commit is contained in:
@ -39,7 +39,6 @@ const setup = () => {
|
|||||||
|
|
||||||
/** @param {Electron.BrowserWindow} win */
|
/** @param {Electron.BrowserWindow} win */
|
||||||
module.exports = (win, options) => {
|
module.exports = (win, options) => {
|
||||||
config.init(options);
|
|
||||||
// Register the callback for new song information
|
// Register the callback for new song information
|
||||||
is.windows() && options.interactive ?
|
is.windows() && options.interactive ?
|
||||||
require("./interactive")(win) :
|
require("./interactive")(win) :
|
||||||
|
|||||||
@ -1,23 +1,5 @@
|
|||||||
const { setOptions, setMenuOptions } = require("../../config/plugins");
|
const { PluginConfig } = require("../../config/dynamic");
|
||||||
const defaultConfig = require("../../config/defaults");
|
|
||||||
|
|
||||||
let config = defaultConfig.plugins["notifications"];
|
const config = new PluginConfig("notifications");
|
||||||
|
|
||||||
module.exports.init = (options) => {
|
module.exports = { ...config };
|
||||||
config = { ...config, ...options };
|
|
||||||
};
|
|
||||||
|
|
||||||
module.exports.setAndMaybeRestart = (option, value) => {
|
|
||||||
config[option] = value;
|
|
||||||
setMenuOptions("notifications", config);
|
|
||||||
};
|
|
||||||
|
|
||||||
module.exports.set = (option, value) => {
|
|
||||||
config[option] = value;
|
|
||||||
setOptions("notifications", config);
|
|
||||||
};
|
|
||||||
|
|
||||||
module.exports.get = (option) => {
|
|
||||||
let res = config[option];
|
|
||||||
return res;
|
|
||||||
};
|
|
||||||
|
|||||||
Reference in New Issue
Block a user