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
This commit is contained in:
Scott Nonnenberg 2017-09-06 18:21:38 -07:00
parent 6e5afce7d2
commit af81b1a045
No known key found for this signature in database
GPG key ID: A4931C09644C654B
2 changed files with 4 additions and 4 deletions

View file

@ -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(); }

View file

@ -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();
}
})