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:
@@ -59,12 +59,14 @@
|
|||||||
this.closeInstaller();
|
this.closeInstaller();
|
||||||
|
|
||||||
if (!this.inboxView) {
|
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({
|
this.inboxView = new Whisper.InboxView({
|
||||||
model: self,
|
model: self,
|
||||||
window: window,
|
window: window,
|
||||||
initialLoadComplete: options.initialLoadComplete
|
initialLoadComplete: options.initialLoadComplete
|
||||||
});
|
});
|
||||||
|
return ConversationController.loadPromise().then(function() {
|
||||||
this.openView(this.inboxView);
|
this.openView(this.inboxView);
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user