From 3b287185ef76b939956410f4af8f7db2a7b699bf Mon Sep 17 00:00:00 2001 From: lilia Date: Tue, 4 Apr 2017 15:38:19 -0700 Subject: [PATCH] Fix autoUpdater error in development --- main.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/main.js b/main.js index 8e05793c5..d86891328 100644 --- a/main.js +++ b/main.js @@ -83,12 +83,14 @@ function createWindow () { // initialization and is ready to create browser windows. // Some APIs can only be used after this event occurs. app.on('ready', function() { - autoUpdater.addListener('update-downloaded', function() { - autoUpdater.quitAndInstall() - }); - autoUpdater.checkForUpdates(); + if (NODE_ENV === 'production') { + autoUpdater.addListener('update-downloaded', function() { + autoUpdater.quitAndInstall() + }); + autoUpdater.checkForUpdates(); + setInterval(function() { autoUpdater.checkForUpdates(); }, autoUpdaterInterval); + } - setInterval(function() { autoUpdater.checkForUpdates(); }, autoUpdaterInterval); createWindow(); })