Fixed issues while testing multiple popups issue. #8316

pull/8616/head
Aditya Toshniwal 2025-03-31 14:28:56 +05:30
parent c001b7b50a
commit cfca6f6218
3 changed files with 30 additions and 24 deletions

View File

@ -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,

View File

@ -98,7 +98,7 @@ function confirm(title, text, onOkClick, onCancelClick, okLabel = gettext('Yes')
return (
<AlertContent text={text} confirm onOkClick={onOkClickClose} onCancelClick={onCancelClickClose} okLabel={okLabel} cancelLabel={cancelLabel} okIcon={okIcon}/>
);
}, {modalId: modalId});
}, {id: modalId});
}
function confirmDelete(title, text, onDeleteClick, onCancelClick, deleteLabel = gettext('Delete'), cancelLabel = gettext('Cancel')) {

View File

@ -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);