From 93d99c0c47dfe83b86616d45b9b9b204afe67ebc Mon Sep 17 00:00:00 2001 From: Rokt33r Date: Tue, 22 Dec 2015 21:50:39 +0900 Subject: [PATCH] fix wrong calling of updater --- main.js | 49 +++++++++++++++---------------------------------- 1 file changed, 15 insertions(+), 34 deletions(-) diff --git a/main.js b/main.js index 93733f2c..84787056 100644 --- a/main.js +++ b/main.js @@ -247,41 +247,22 @@ app.on('ready', function () { Menu.setApplicationMenu(menu) } - if (process.platform === 'darwin') { - setInterval(function () { - if (update == null) autoUpdater.checkForUpdates() - }, 1000 * 60 * 60 * 24) - - ipc.on('check-update', function (event, msg) { - if (update == null) autoUpdater.checkForUpdates() - }) - - ipc.on('update-app', function (event, msg) { - if (update != null) { - appQuit = true - update() - } - }) - - autoUpdater.checkForUpdates() - } else if (process.platform === 'win32') { - setInterval(function () { - checkUpdate() - }, 1000 * 60 * 60 * 24) - - ipc.on('check-update', function (event, msg) { - if (update == null) checkUpdate() - }) - - ipc.on('update-app', function (event, msg) { - if (isUpdateReady) { - appQuit = true - updater.install() - } - }) - + setInterval(function () { checkUpdate() - } + }, 1000 * 60 * 60 * 24) + + ipc.on('check-update', function (event, msg) { + if (update == null) checkUpdate() + }) + + ipc.on('update-app', function (event, msg) { + if (isUpdateReady) { + appQuit = true + updater.install() + } + }) + + checkUpdate() mainWindow = require('./atom-lib/main-window') if (process.platform === 'win32') {