From b2750d35ee7d2dcaac5df9b820dde98d7945c837 Mon Sep 17 00:00:00 2001 From: Jhen Date: Tue, 15 Nov 2016 20:32:25 +0800 Subject: [PATCH] Fix checking for update --- electron/update.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/electron/update.js b/electron/update.js index 527ca5fc..92146544 100644 --- a/electron/update.js +++ b/electron/update.js @@ -31,8 +31,8 @@ export default (mainWindow, icon, notify) => { icon, message: err.message, }); - checking = false; console.log('[Updater]', err.message); + checking = false; return; } if (err || !status) { @@ -48,9 +48,9 @@ export default (mainWindow, icon, notify) => { icon, message: 'The new version has been released.', }); + checking = false; if (index === 1) return; shell.openExternal('https://github.com/jhen0409/react-native-debugger/releases'); - checking = false; console.log('[Updater] Open external link.'); return; } @@ -72,10 +72,8 @@ export default (mainWindow, icon, notify) => { 'Please restart the application to apply the updates.', detail: `${releaseName}\n\n${releaseNotes}`, }); - if (index === 1) { - checking = false; - return; - } + checking = false; + if (index === 1) return; updater.install(); }); };