diff --git a/runtime/src/js/pgadmin.js b/runtime/src/js/pgadmin.js index 452246ebe..7ef8b7ef8 100644 --- a/runtime/src/js/pgadmin.js +++ b/runtime/src/js/pgadmin.js @@ -83,38 +83,41 @@ Menu.setApplicationMenu(null); // pgAdmin tried to open the window on the display where the it // was last closed. function isWithinDisplayBounds(pos) { - const displays = screen.getAllDisplays() + const displays = screen.getAllDisplays(); return displays.reduce((result, display) => { - const area = display.workArea + const area = display.workArea; return ( result || (pos.x >= area.x && pos.y >= area.y && pos.x < area.x + area.width && pos.y < area.y + area.height) - ) - }, false) + ); + }, false); } function openConfigure() { - if (configureWindow === null){ - configureWindow = new BrowserWindow({ - show: false, - width: 600, - height: 580, - position: 'center', - resizable: false, - parent: pgAdminMainScreen, - icon: '../../assets/pgAdmin4.png', - webPreferences: { - preload: path.join(__dirname, 'other_preload.js'), - }, - }); - configureWindow.loadFile('./src/html/configure.html'); - configureWindow.once('ready-to-show', ()=>{ + if (configureWindow === null || configureWindow?.isDestroyed()) { + configureWindow = new BrowserWindow({ + show: false, + width: 600, + height: 580, + position: 'center', + resizable: false, + parent: pgAdminMainScreen, + icon: '../../assets/pgAdmin4.png', + webPreferences: { + preload: path.join(__dirname, 'other_preload.js'), + }, + }); + configureWindow.loadFile('./src/html/configure.html'); + configureWindow.once('ready-to-show', ()=>{ + configureWindow.show(); + }); + } else { + configureWindow.hide(); configureWindow.show(); - }); -} + } } function showErrorDialog(intervalID) { @@ -327,7 +330,7 @@ function launchPgAdminWindow() { setupMenu(pgAdminMainScreen, { 'view_logs': ()=>{ - if(viewLogWindow === null){ + if(viewLogWindow === null || viewLogWindow?.isDestroyed()) { viewLogWindow = new BrowserWindow({ show: false, width: 800, @@ -344,6 +347,9 @@ function launchPgAdminWindow() { viewLogWindow.once('ready-to-show', ()=>{ viewLogWindow.show(); }); + } else { + viewLogWindow.hide(); + viewLogWindow.show(); } }, 'configure': openConfigure, diff --git a/web/pgadmin/static/js/helpers/ModalProvider.jsx b/web/pgadmin/static/js/helpers/ModalProvider.jsx index 4a7671657..abf3d245f 100644 --- a/web/pgadmin/static/js/helpers/ModalProvider.jsx +++ b/web/pgadmin/static/js/helpers/ModalProvider.jsx @@ -98,7 +98,7 @@ function confirm(title, text, onOkClick, onCancelClick, okLabel = gettext('Yes') return ( ); - }, {modalId: modalId}); + }, {id: modalId}); } function confirmDelete(title, text, onDeleteClick, onCancelClick, deleteLabel = gettext('Delete'), cancelLabel = gettext('Cancel')) { diff --git a/web/pgadmin/tools/sqleditor/static/js/components/sections/ResultSet.jsx b/web/pgadmin/tools/sqleditor/static/js/components/sections/ResultSet.jsx index 03f8aa74f..d01f13028 100644 --- a/web/pgadmin/tools/sqleditor/static/js/components/sections/ResultSet.jsx +++ b/web/pgadmin/tools/sqleditor/static/js/components/sections/ResultSet.jsx @@ -1147,7 +1147,7 @@ export function ResultSet() { eventBus.fireEvent(QUERY_TOOL_EVENTS.WARN_SAVE_TEXT_CLOSE); }} /> - ), {modalId:modalId}); + ), {id: modalId}); }; useEffect(()=>{ let isDirty = _.size(dataChangeStore.updated) || _.size(dataChangeStore.added) || _.size(dataChangeStore.deleted);