From 39795170c115910487d7a0d03393fa8cf34d1633 Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Mon, 24 Jul 2017 18:54:13 -0700 Subject: [PATCH] Handle the 'extension loaded, reopen window' scenario Not sure exactly how to think about Chrome app lifetimes, so we're being conservative. We only show the full-application loading screen once, on first display of the inbox. FREEBIE --- js/background.js | 6 +++++- js/views/inbox_view.js | 10 +++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/js/background.js b/js/background.js index 41e025f58..7212f5ffe 100644 --- a/js/background.js +++ b/js/background.js @@ -443,7 +443,11 @@ return ConversationController.updateInbox().then(function() { try { if (self.inboxView) { self.inboxView.remove(); } - self.inboxView = new Whisper.InboxView({model: self, window: destWindow}); + self.inboxView = new Whisper.InboxView({ + model: self, + window: destWindow, + initialLoadComplete: initialLoadComplete + }); self.openConversation(getOpenConversation()); return self.inboxView; diff --git a/js/views/inbox_view.js b/js/views/inbox_view.js index baa540e4f..217886e78 100644 --- a/js/views/inbox_view.js +++ b/js/views/inbox_view.js @@ -80,6 +80,8 @@ .addClass(theme); }, initialize: function (options) { + options = options || {}; + this.ready = false; this.render(); this.applyTheme(); @@ -90,9 +92,11 @@ model: { window: options.window } }); - this.appLoadingScreen = new Whisper.AppLoadingScreen(); - this.appLoadingScreen.render(); - this.appLoadingScreen.$el.prependTo(this.el); + if (!options.initialLoadComplete) { + this.appLoadingScreen = new Whisper.AppLoadingScreen(); + this.appLoadingScreen.render(); + this.appLoadingScreen.$el.prependTo(this.el); + } var inboxCollection = getInboxCollection();