From af81b1a045647c768ed4f79b244dddff85424c1d Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Wed, 6 Sep 2017 18:21:38 -0700 Subject: [PATCH] Fix unlinked loading screen hang, fix error dialog on start (#1440) * main.js: check for truthiness of mainwindow, not === null FREEBIE * background.js: Connect to websocket even if we are unlinked We know registration isn't done, but it has been done before. So instead of sitting tight, we connect to the socket to start everything up and attempt to the websocket once more. FREEBIE --- js/background.js | 2 +- main.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/js/background.js b/js/background.js index 2bb8dd58b..5a506a3df 100644 --- a/js/background.js +++ b/js/background.js @@ -159,7 +159,7 @@ function connect(firstRun) { window.removeEventListener('online', connect); - if (!Whisper.Registration.isDone()) { return; } + if (!Whisper.Registration.everDone()) { return; } if (Whisper.Import.isIncomplete()) { return; } if (messageReceiver) { messageReceiver.close(); } diff --git a/main.js b/main.js index 19e5edfa9..4174a8927 100644 --- a/main.js +++ b/main.js @@ -201,10 +201,10 @@ app.on('window-all-closed', function () { app.on('activate', function () { // On OS X it's common to re-create a window in the app when the // dock icon is clicked and there are no other windows open. - if (mainWindow === null) { - createWindow(); - } else { + if (mainWindow) { mainWindow.show(); + } else { + createWindow(); } })