File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,7 +30,11 @@ function createMenu(mainWindow) {
3030 {
3131 label : "Reload" ,
3232 accelerator : "CmdOrCtrl+R" ,
33- click : ( ) => mainWindow . reload ( ) ,
33+ click : ( _ , browserWindow ) => {
34+ if ( browserWindow ) {
35+ browserWindow . reload ( ) ;
36+ }
37+ } ,
3438 } ,
3539 { type : "separator" } ,
3640 {
@@ -61,7 +65,11 @@ function createMenu(mainWindow) {
6165 {
6266 label : "Toggle DevTools" ,
6367 accelerator : "F12" ,
64- click : ( ) => mainWindow . webContents . toggleDevTools ( ) ,
68+ click : ( _ , browserWindow ) => {
69+ if ( browserWindow ) {
70+ browserWindow . webContents . toggleDevTools ( ) ;
71+ }
72+ } ,
6573 } ,
6674 ] ,
6775 } ,
@@ -118,7 +126,7 @@ function createMenu(mainWindow) {
118126 ] ;
119127
120128 const menu = Menu . buildFromTemplate ( template ) ;
121- Menu . setApplicationMenu ( menu ) ;
129+ return menu ;
122130}
123131
124132export { createMenu } ;
Original file line number Diff line number Diff line change @@ -51,7 +51,8 @@ function createWindow(screenWidth, screenHeight) {
5151 loadView ( currentView ) ;
5252
5353 // Create application menu
54- createMenu ( mainWindow ) ;
54+ const menu = createMenu ( mainWindow ) ;
55+ mainWindow . setApplicationMenu ( menu ) ;
5556
5657 // Open DevTools in development mode
5758 if ( ! app . isPackaged ) {
You can’t perform that action at this time.
0 commit comments