Export: Handle synchronous 'shutdown-complete' event (already offline)

FREEBIE
pull/749/head
Scott Nonnenberg 8 years ago
parent d31d1712b1
commit 3d8aa3b8a2
No known key found for this signature in database
GPG Key ID: A4931C09644C654B

@ -142,11 +142,7 @@
this.render();
},
beginMigration: function() {
// tells MessageReceiver to disconnect and drain its queue, will fire
// 'shutdown-complete' event when that is done.
Whisper.Migration.init();
Whisper.events.on('shutdown-complete', function() {
Whisper.events.once('shutdown-complete', function() {
Whisper.Migration.beginExport()
.then(this.completeMigration.bind(this))
.catch(this.onError.bind(this));
@ -155,6 +151,11 @@
this.render();
}.bind(this));
// tells MessageReceiver to disconnect and drain its queue, will fire
// 'shutdown-complete' event when that is done. Might result in a synchronous
// event, so call it after we register our callback.
Whisper.Migration.init();
// Rendering because we're now in the 'disconnected' state
this.render();
},

Loading…
Cancel
Save