AppView.createInbox() - set this.inboxView immediately to be ready

If the 'empty' event is fired between the updateInbox() call and the
new InboxView() call afterwards, then the loading screen will never go
away. We fix that by immediately creating the InboxView but only adding
it to the DOM when the backing data is ready.

FREEBIE
This commit is contained in:
Scott Nonnenberg 2017-07-28 17:15:41 -07:00
parent e441a662f0
commit f37af04818
No known key found for this signature in database
GPG Key ID: A4931C09644C654B
1 changed files with 7 additions and 5 deletions

View File

@ -59,12 +59,14 @@
this.closeInstaller();
if (!this.inboxView) {
return ConversationController.loadPromise().then(function() {
// We create the inbox immediately to make sure we're ready to receive the
// empty event after getting down to zero messages in the queue.
this.inboxView = new Whisper.InboxView({
model: self,
window: window,
initialLoadComplete: options.initialLoadComplete
});
return ConversationController.loadPromise().then(function() {
this.openView(this.inboxView);
}.bind(this));
} else {