SDA-3516 - Focus main webContents (#1321)

This commit is contained in:
Kiran Niranjan 2022-01-12 14:04:45 +05:30 committed by GitHub
parent 312af153ca
commit 4f59a4694d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -124,6 +124,7 @@ if (!allowMultiInstance) {
`main: We've got a second instance of the app, will check if it's allowed and exit if not`,
);
const mainWindow = windowHandler.getMainWindow();
const mainWebContents = windowHandler.getMainWebContents();
if (mainWindow && !mainWindow.isDestroyed()) {
if (isMac) {
logger.info(`main: We are on mac, so, showing the existing window`);
@ -136,6 +137,9 @@ if (!allowMultiInstance) {
mainWindow.focus();
isAppAlreadyOpen = true;
protocolHandler.processArgv(argv, isAppAlreadyOpen);
if (mainWebContents && !mainWebContents.isDestroyed()) {
mainWebContents.focus();
}
}
});
startApplication();