Skip to content

Commit cfca6f6

Browse files
Fixed issues while testing multiple popups issue. #8316
1 parent c001b7b commit cfca6f6

File tree

3 files changed

+30
-24
lines changed

3 files changed

+30
-24
lines changed

runtime/src/js/pgadmin.js

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -83,38 +83,41 @@ Menu.setApplicationMenu(null);
8383
// pgAdmin tried to open the window on the display where the it
8484
// was last closed.
8585
function 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

9999
function 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

120123
function 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,

web/pgadmin/static/js/helpers/ModalProvider.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ function confirm(title, text, onOkClick, onCancelClick, okLabel = gettext('Yes')
9898
return (
9999
<AlertContent text={text} confirm onOkClick={onOkClickClose} onCancelClick={onCancelClickClose} okLabel={okLabel} cancelLabel={cancelLabel} okIcon={okIcon}/>
100100
);
101-
}, {modalId: modalId});
101+
}, {id: modalId});
102102
}
103103

104104
function confirmDelete(title, text, onDeleteClick, onCancelClick, deleteLabel = gettext('Delete'), cancelLabel = gettext('Cancel')) {

web/pgadmin/tools/sqleditor/static/js/components/sections/ResultSet.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1147,7 +1147,7 @@ export function ResultSet() {
11471147
eventBus.fireEvent(QUERY_TOOL_EVENTS.WARN_SAVE_TEXT_CLOSE);
11481148
}}
11491149
/>
1150-
), {modalId:modalId});
1150+
), {id: modalId});
11511151
};
11521152
useEffect(()=>{
11531153
let isDirty = _.size(dataChangeStore.updated) || _.size(dataChangeStore.added) || _.size(dataChangeStore.deleted);

0 commit comments

Comments
 (0)