@@ -58,10 +58,10 @@ var info = fs.existsSync(file) ? JSON.parse(fs.readFileSync(file,"utf8")) :{}
5858
5959// for capturing proxy authentication request
6060let reservedLoginCallback = null
61- let proxy = null
61+ let proxyPopUp = null
6262let loginCount = 0
6363ipcMain . on ( 'authSubmitted' , ( _ , { id, password} ) => {
64- proxy . close ( )
64+ proxyPopUp . close ( )
6565 reservedLoginCallback ( id , password )
6666 reservedLoginCallback = null
6767 info . proxy = { "id" :id , "password" :password }
@@ -82,8 +82,9 @@ app.on('ready', function () {
8282 callback ( aInfo . id , aInfo . password ) ;
8383 } else {
8484 reservedLoginCallback = callback
85- proxy = new BrowserWindow ( {
86- width : 450 ,
85+ if ( proxyPopUp ) proxyPopUp . close ( ) // discard multiple popups
86+ proxyPopUp = new BrowserWindow ( {
87+ width : 400 ,
8788 height : 200 ,
8889 show :false ,
8990 modal :true ,
@@ -96,11 +97,13 @@ app.on('ready', function () {
9697 enableRemoteModule : true ,
9798 contextIsolation :false
9899 } , } )
99- proxy . loadFile ( "src/html/auth.html" )
100- proxy . once ( 'ready-to-show' , ( ) => {
101- proxy . webContents . send ( 'details' , authInfo )
102- proxy . show ( ) ;
100+ proxyPopUp . loadFile ( "src/html/auth.html" )
101+ proxyPopUp . once ( 'ready-to-show' , ( ) => {
102+ proxyPopUp . webContents . send ( 'details' , authInfo )
103+ proxyPopUp . show ( ) ;
103104 } )
105+ proxyPopUp . once ( 'closed' , ( ) => { proxyPopUp = null } )
106+
104107 }
105108 loginCount ++
106109 }
@@ -149,7 +152,7 @@ const helpMenu = {
149152 childWindow . loadFile ( 'src/html/doc.html' )
150153 childWindow . maximize ( ) ;
151154 childWindow . setMenuBarVisibility ( false ) ;
152- childWindow . show ( ) ;
155+ childWindow . once ( 'ready-to-show' , childWindow . show )
153156 }
154157 } , {
155158 label : "Sample Data" ,
@@ -185,6 +188,7 @@ const helpMenu = {
185188 minWidth : 500 ,
186189 maxWidth : 700 ,
187190 width :600 ,
191+ show :false ,
188192 title : "Interactive Data Editor - About" ,
189193 webPreferences : {
190194 nodeIntegration : true ,
@@ -195,6 +199,7 @@ const helpMenu = {
195199 } ) ;
196200 childWindow . loadFile ( './src/html/about.html' )
197201 childWindow . setMenuBarVisibility ( false ) ;
202+ childWindow . once ( 'ready-to-show' , childWindow . show )
198203 }
199204 } ,
200205 {
0 commit comments