@@ -83,38 +83,41 @@ Menu.setApplicationMenu(null);
8383// pgAdmin tried to open the window on the display where the it
8484// was last closed.
8585function isWithinDisplayBounds ( pos ) {
86- const displays = screen . getAllDisplays ( )
86+ const displays = screen . getAllDisplays ( ) ;
8787 return displays . reduce ( ( result , display ) => {
88- const area = display . workArea
88+ const area = display . workArea ;
8989 return (
9090 result ||
9191 ( pos . x >= area . x &&
9292 pos . y >= area . y &&
9393 pos . x < area . x + area . width &&
9494 pos . y < area . y + area . height )
95- )
96- } , false )
95+ ) ;
96+ } , false ) ;
9797}
9898
9999function openConfigure ( ) {
100- if ( configureWindow === null ) {
101- configureWindow = new BrowserWindow ( {
102- show : false ,
103- width : 600 ,
104- height : 580 ,
105- position : 'center' ,
106- resizable : false ,
107- parent : pgAdminMainScreen ,
108- icon : '../../assets/pgAdmin4.png' ,
109- webPreferences : {
110- preload : path . join ( __dirname , 'other_preload.js' ) ,
111- } ,
112- } ) ;
113- configureWindow . loadFile ( './src/html/configure.html' ) ;
114- configureWindow . once ( 'ready-to-show' , ( ) => {
100+ if ( configureWindow === null || configureWindow ?. isDestroyed ( ) ) {
101+ configureWindow = new BrowserWindow ( {
102+ show : false ,
103+ width : 600 ,
104+ height : 580 ,
105+ position : 'center' ,
106+ resizable : false ,
107+ parent : pgAdminMainScreen ,
108+ icon : '../../assets/pgAdmin4.png' ,
109+ webPreferences : {
110+ preload : path . join ( __dirname , 'other_preload.js' ) ,
111+ } ,
112+ } ) ;
113+ configureWindow . loadFile ( './src/html/configure.html' ) ;
114+ configureWindow . once ( 'ready-to-show' , ( ) => {
115+ configureWindow . show ( ) ;
116+ } ) ;
117+ } else {
118+ configureWindow . hide ( ) ;
115119 configureWindow . show ( ) ;
116- } ) ;
117- }
120+ }
118121}
119122
120123function showErrorDialog ( intervalID ) {
@@ -327,7 +330,7 @@ function launchPgAdminWindow() {
327330
328331 setupMenu ( pgAdminMainScreen , {
329332 'view_logs' : ( ) => {
330- if ( viewLogWindow === null ) {
333+ if ( viewLogWindow === null || viewLogWindow ?. isDestroyed ( ) ) {
331334 viewLogWindow = new BrowserWindow ( {
332335 show : false ,
333336 width : 800 ,
@@ -344,6 +347,9 @@ function launchPgAdminWindow() {
344347 viewLogWindow . once ( 'ready-to-show' , ( ) => {
345348 viewLogWindow . show ( ) ;
346349 } ) ;
350+ } else {
351+ viewLogWindow . hide ( ) ;
352+ viewLogWindow . show ( ) ;
347353 }
348354 } ,
349355 'configure' : openConfigure ,
0 commit comments