From 04cd99b931bf2808b63990cc13d8b330f72e4ec0 Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Thu, 12 Nov 2020 18:45:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=E5=90=8E=E6=B2=A1=E6=9C=89=E5=AE=8C=E5=85=A8=E9=80=80=E5=87=BA?= =?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 --- packages/gui/package.json | 2 +- packages/gui/src/background.js | 20 ++++++++------------ 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/packages/gui/package.json b/packages/gui/package.json index 242bd80a..b1ab3dea 100644 --- a/packages/gui/package.json +++ b/packages/gui/package.json @@ -1,6 +1,6 @@ { "name": "@docmirror/dev-sidecar-gui", - "version": "1.1.0", + "version": "1.0.2", "private": false, "license": "MPL-2.0", "scripts": { diff --git a/packages/gui/src/background.js b/packages/gui/src/background.js index 584eb2f2..22856d41 100644 --- a/packages/gui/src/background.js +++ b/packages/gui/src/background.js @@ -121,7 +121,6 @@ app.disableHardwareAcceleration() // 禁用gpu // 禁止双开 const isFirstInstance = app.requestSingleInstanceLock() -let isShutdown = false if (!isFirstInstance) { console.log('is second instance') setTimeout(() => { @@ -130,15 +129,12 @@ if (!isFirstInstance) { } else { app.on('before-quit', async (event) => { console.log('before-quit') - if (!isShutdown) { - event.preventDefault() - // if (tray) { - // tray.displayBalloon({ title: '正在关闭,请稍候...', content: '正在关闭中,请稍候。。。' }) - // } - await bridge.devSidecar.api.shutdown() - isShutdown = true - app.quit() - } + event.preventDefault() + // if (tray) { + // tray.displayBalloon({ title: '正在关闭,请稍候...', content: '正在关闭中,请稍候。。。' }) + // } + await bridge.devSidecar.api.shutdown() + app.exit() }) app.on('second-instance', (event, commandLine, workingDirectory) => { console.log('new app started', commandLine) @@ -187,8 +183,8 @@ if (!isFirstInstance) { return true } }) - updateUrl = 'https://dev-sidecar.docmirror.cn/update/' - // updateUrl = 'http://localhost/dev-sidecar/' + // updateUrl = 'https://dev-sidecar.docmirror.cn/update/' + updateUrl = 'http://localhost/dev-sidecar/' } // 自动更新 updateHandle(win, updateUrl)