fix restart app on config change option

This commit is contained in:
Araxeus
2022-01-20 22:54:19 +02:00
parent 44aa62c9c8
commit 74b67c3d33
12 changed files with 54 additions and 40 deletions

View File

@ -1,11 +1,17 @@
const defaultConfig = require("./defaults");
const plugins = require("./plugins");
const store = require("./store");
const { restart } = require("../providers/app-controls");
const set = (key, value) => {
store.set(key, value);
};
function setMenuOption(key, value) {
set(key, value);
if (store.get("options.restartOnConfigChanges")) restart();
}
const get = (key) => {
return store.get(key);
};
@ -14,6 +20,7 @@ module.exports = {
defaultConfig,
get,
set,
setMenuOption,
edit: () => store.openInEditor(),
watch: (cb) => {
store.onDidChange("options", cb);