From 1c56e7fea641c069e75a80ba1255c58cac5b3764 Mon Sep 17 00:00:00 2001 From: TC Date: Sun, 12 Apr 2020 18:52:07 +0200 Subject: [PATCH] Add options in store (tray, app visible, auto-update) --- store/index.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/store/index.js b/store/index.js index 82cefaab..4ae9af01 100644 --- a/store/index.js +++ b/store/index.js @@ -9,13 +9,25 @@ const store = new Store({ }, url: "https://music.youtube.com", plugins: ["navigation", "shortcuts", "adblocker"], + options: { + tray: false, + appVisible: true, + autoUpdates: true + } } }); module.exports = { store: store, + // Plugins isPluginEnabled: plugin => plugins.isEnabled(store, plugin), getEnabledPlugins: () => plugins.getEnabledPlugins(store), enablePlugin: plugin => plugins.enablePlugin(store, plugin), disablePlugin: plugin => plugins.disablePlugin(store, plugin), + // Options + setOptions: options => + store.set("options", { ...store.get("options"), ...options }), + isTrayEnabled: () => store.get("options.tray"), + isAppVisible: () => store.get("options.appVisible"), + autoUpdate: () => store.get("options.autoUpdates") };