Skip to content

Commit f4fe5c2

Browse files
committed
Allow editing config (advanced)
1 parent a5130c1 commit f4fe5c2

File tree

2 files changed

+30
-13
lines changed

2 files changed

+30
-13
lines changed

config/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ const get = (key) => {
1212
module.exports = {
1313
get,
1414
set,
15+
edit: () => store.openInEditor(),
1516
plugins,
1617
};

menu.js

+29-13
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,29 @@ const config = require("./config");
77
const mainMenuTemplate = (win) => [
88
{
99
label: "Plugins",
10-
submenu: getAllPlugins().map((plugin) => {
11-
return {
12-
label: plugin,
13-
type: "checkbox",
14-
checked: config.plugins.isEnabled(plugin),
15-
click: (item) => {
16-
if (item.checked) {
17-
config.plugins.enable(plugin);
18-
} else {
19-
config.plugins.disable(plugin);
20-
}
10+
submenu: [
11+
...getAllPlugins().map((plugin) => {
12+
return {
13+
label: plugin,
14+
type: "checkbox",
15+
checked: config.plugins.isEnabled(plugin),
16+
click: (item) => {
17+
if (item.checked) {
18+
config.plugins.enable(plugin);
19+
} else {
20+
config.plugins.disable(plugin);
21+
}
22+
},
23+
};
24+
}),
25+
{ type: "separator" },
26+
{
27+
label: "Advanced options",
28+
click: () => {
29+
config.edit();
2130
},
22-
};
23-
}),
31+
},
32+
],
2433
},
2534
{
2635
label: "Options",
@@ -101,6 +110,7 @@ const mainMenuTemplate = (win) => [
101110
},
102111
],
103112
},
113+
{ type: "separator" },
104114
{
105115
label: "Toggle DevTools",
106116
// Cannot use "toggleDevTools" role in MacOS
@@ -114,6 +124,12 @@ const mainMenuTemplate = (win) => [
114124
}
115125
},
116126
},
127+
{
128+
label: "Advanced options",
129+
click: () => {
130+
config.edit();
131+
},
132+
},
117133
],
118134
},
119135
];

0 commit comments

Comments
 (0)