From e96502ba5e895f84ebbfd5939119407b85978d90 Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Wed, 6 Dec 2017 12:44:23 -0800 Subject: [PATCH] Delay our call to quitAndInstall(); doesn't work inside callback (#1866) --- app/auto_update.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/auto_update.js b/app/auto_update.js index 52000881f..f68211113 100644 --- a/app/auto_update.js +++ b/app/auto_update.js @@ -40,8 +40,13 @@ function showUpdateDialog(mainWindow, messages) { dialog.showMessageBox(mainWindow, options, function(response) { if (response == RESTART_BUTTON) { - windowState.markShouldQuit(); - autoUpdater.quitAndInstall(); + // We delay these update calls because they don't seem to work in this + // callback - but only if the message box has a parent window. + // Fixes this bug: https://github.com/WhisperSystems/Signal-Desktop/issues/1864 + setTimeout(function() { + windowState.markShouldQuit(); + autoUpdater.quitAndInstall(); + }, 200); } showingDialog = false;