From fb0e61f3b00857f49c2191db083739b7dd5b97a7 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Tue, 10 Sep 2019 21:49:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=AD=89=E5=BE=85=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E6=9C=AA=E6=B8=85=E7=A9=BA=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/utils/autoUpdate.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/utils/autoUpdate.js b/src/main/utils/autoUpdate.js index e295d946..f0a3dd65 100644 --- a/src/main/utils/autoUpdate.js +++ b/src/main/utils/autoUpdate.js @@ -69,11 +69,14 @@ const handleSendEvent = action => { module.exports = isFirstCheckedUpdate => { if (!isFirstCheckedUpdate) { - waitEvent.forEach((event, index) => { - setTimeout(() => { // 延迟发送事件,过早发送可能渲染进程还没启动完成 - global.mainWindow.webContents.send(event.type, event.info) - }, 2000 * (index + 1)) - }) + if (waitEvent.length) { + waitEvent.forEach((event, index) => { + setTimeout(() => { // 延迟发送事件,过早发送可能渲染进程还没启动完成 + global.mainWindow.webContents.send(event.type, event.info) + }, 2000 * (index + 1)) + }) + waitEvent = [] + } return } autoUpdater.on('checking-for-update', () => {