From 57636b9022c7f7a0be88a25625abecaa073bf0aa Mon Sep 17 00:00:00 2001 From: Sirisak Lueangsaksri <1087399+spywhere@users.noreply.github.com> Date: Sun, 31 Jul 2022 00:31:18 +0700 Subject: [PATCH] macOS: Fix "main window cannot be activated" (fix #1415, PR #1417) --- app/src/components/mainWindow.ts | 4 ---- app/src/main.ts | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/components/mainWindow.ts b/app/src/components/mainWindow.ts index 4a66366..0dda35b 100644 --- a/app/src/components/mainWindow.ts +++ b/app/src/components/mainWindow.ts @@ -154,10 +154,6 @@ export async function createMainWindow( await clearCache(mainWindow); } - if (options.targetUrl) { - await mainWindow.loadURL(options.targetUrl); - } - setupCloseEvent(options, mainWindow); return mainWindow; diff --git a/app/src/main.ts b/app/src/main.ts index cf1bbc8..1d21e8b 100644 --- a/app/src/main.ts +++ b/app/src/main.ts @@ -415,6 +415,10 @@ async function onReady(): Promise { }) .catch((err) => log.error('dialog.showMessageBox ERROR', err)); } + + if (appArgs.targetUrl) { + await mainWindow.loadURL(appArgs.targetUrl); + } } app.on(