File tree 4 files changed +19
-4
lines changed
4 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ const defaultConfig = {
11
11
hideMenu : false ,
12
12
startAtLogin : false ,
13
13
disableHardwareAcceleration : false ,
14
+ restartOnConfigChanges : false ,
14
15
} ,
15
16
plugins : {
16
17
// Enabled plugins
Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ module.exports = {
13
13
get,
14
14
set,
15
15
edit : ( ) => store . openInEditor ( ) ,
16
- watch : ( cb ) => store . onDidAnyChange ( cb ) ,
16
+ watch : ( cb ) => {
17
+ store . onDidChange ( "options" , cb ) ;
18
+ store . onDidChange ( "plugins" , cb ) ;
19
+ } ,
17
20
plugins,
18
21
} ;
Original file line number Diff line number Diff line change @@ -189,9 +189,12 @@ app.on("activate", () => {
189
189
app . on ( "ready" , ( ) => {
190
190
mainWindow = createMainWindow ( ) ;
191
191
setApplicationMenu ( mainWindow ) ;
192
- config . watch ( ( ) => {
193
- setApplicationMenu ( mainWindow ) ;
194
- } ) ;
192
+ if ( config . get ( "options.restartOnConfigChanges" ) ) {
193
+ config . watch ( ( ) => {
194
+ app . relaunch ( ) ;
195
+ app . exit ( ) ;
196
+ } ) ;
197
+ }
195
198
setUpTray ( app , mainWindow ) ;
196
199
197
200
// Autostart at login
Original file line number Diff line number Diff line change @@ -50,6 +50,14 @@ const mainMenuTemplate = (win) => [
50
50
config . set ( "options.disableHardwareAcceleration" , item . checked ) ;
51
51
} ,
52
52
} ,
53
+ {
54
+ label : "Restart on config changes" ,
55
+ type : "checkbox" ,
56
+ checked : config . get ( "options.restartOnConfigChanges" ) ,
57
+ click : ( item ) => {
58
+ config . set ( "options.restartOnConfigChanges" , item . checked ) ;
59
+ } ,
60
+ } ,
53
61
...( is . windows ( ) || is . linux ( )
54
62
? [
55
63
{
You can’t perform that action at this time.
0 commit comments