@@ -8,21 +8,21 @@ const electron = require("electron");
88const path = require ( "path" ) ;
99const os = require ( "os" ) ;
1010const pkg = require ( "../../../../package.json" ) ;
11- let updateWindow = undefined ;
11+ let mainWindow = undefined ;
1212
1313function getWindow ( ) {
14- return updateWindow ;
14+ return mainWindow ;
1515}
1616
1717function destroyWindow ( ) {
18- if ( ! updateWindow ) return ;
19- updateWindow . close ( ) ;
20- updateWindow = undefined ;
18+ if ( ! mainWindow ) return ;
19+ mainWindow . close ( ) ;
20+ mainWindow = undefined ;
2121}
2222
2323function createWindow ( ) {
2424 destroyWindow ( ) ;
25- updateWindow = new electron . BrowserWindow ( {
25+ mainWindow = new electron . BrowserWindow ( {
2626 title : pkg . preductname ,
2727 width : 1280 ,
2828 height : 720 ,
@@ -39,12 +39,11 @@ function createWindow() {
3939 } ,
4040 } ) ;
4141 electron . Menu . setApplicationMenu ( null ) ;
42- updateWindow . setMenuBarVisibility ( false ) ;
43- updateWindow . loadFile ( path . join ( electron . app . getAppPath ( ) , 'src' , 'launcher.html' ) ) ;
44- updateWindow . webContents . openDevTools ( )
45- updateWindow . once ( 'ready-to-show' , ( ) => {
46- if ( updateWindow ) {
47- updateWindow . show ( ) ;
42+ mainWindow . setMenuBarVisibility ( false ) ;
43+ mainWindow . loadFile ( path . join ( electron . app . getAppPath ( ) , 'src' , 'launcher.html' ) ) ;
44+ mainWindow . once ( 'ready-to-show' , ( ) => {
45+ if ( mainWindow ) {
46+ mainWindow . show ( ) ;
4847 }
4948 } ) ;
5049}
0 commit comments