SDA-3516 - Focus main webContents (#1321)

This commit is contained in:
Kiran Niranjan authored and GitHub committed 2022-01-12 14:04:45 +05:30
1 parent 312af153ca
commit 4f59a4694d
1 file changed
+4
+4
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();