From f0dc76c7a403ad60ccb4b49a8f6c47c393886cdb Mon Sep 17 00:00:00 2001 From: lyswhut Date: Sat, 20 Jun 2020 13:15:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9F=90=E4=BA=9B=E6=83=85?= =?UTF-8?q?=E5=86=B5=E4=B8=8B=E4=BB=8E=E6=89=98=E7=9B=98=E8=BF=98=E5=8E=9F?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E5=90=8E=E6=97=A0=E6=B3=95=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/index.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/index.js b/src/main/index.js index e7198ace..7c7de8fa 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -8,13 +8,14 @@ if (!app.requestSingleInstanceLock()) { } if (!global.modals) global.modals = {} app.on('second-instance', (event, argv, cwd) => { - if (global.modals.mainWindow) { - if (global.modals.mainWindow.isMinimized()) { - global.modals.mainWindow.restore() - } else if (global.modals.mainWindow.isVisible()) { - global.modals.mainWindow.focus() + if (global.modules.mainWindow) { + if (global.modules.mainWindow.isMinimized()) { + global.modules.mainWindow.restore() + } + if (global.modules.mainWindow.isVisible()) { + global.modules.mainWindow.focus() } else { - global.modals.mainWindow.show() + global.modules.mainWindow.show() } } else { app.quit()