Bug 1484270 - Do not load Account Central until we have a folder selected on startup. r=mkmelin a=jorgk
authoraceman <acelists@atlas.sk>
Fri, 20 Sep 2019 20:31:24 +0200
changeset 35861 73214b3f677012ca0e5a5f15f9ce614f13ae9905
parent 35860 1b244cd88a7fbcc8f9aa5ff1644fa4286ab7aa0d
child 35862 7d67effb480b0cb42e6ccb6a73a95ceb88d45570
push id32
push usermozilla@jorgk.com
push dateFri, 20 Sep 2019 19:37:06 +0000
treeherdercomm-esr68@0f180c4b528c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin, jorgk
bugs1484270
Bug 1484270 - Do not load Account Central until we have a folder selected on startup. r=mkmelin a=jorgk
mail/base/content/folderDisplay.js
--- a/mail/base/content/folderDisplay.js
+++ b/mail/base/content/folderDisplay.js
@@ -1802,16 +1802,22 @@ FolderDisplayWidget.prototype = {
     ).selectedPanel = document.getElementById("threadPaneBox");
   },
 
   /**
    * Cause the displayDeck to display the (preference configurable) account
    *  central page.
    */
   _showAccountCentral() {
+    if (!this.displayedFolder && MailServices.accounts.accounts.length > 0) {
+      // If we have any accounts set up, but no folder is selected yet,
+      // we expect another selection event to come when session restore finishes.
+      // Until then, do nothing.
+      return;
+    }
     var accountBox = document.getElementById("accountCentralBox");
     document.getElementById("displayDeck").selectedPanel = accountBox;
     var prefName = "mailnews.account_central_page.url";
     // oh yeah, 'pref' is a global all right.
     var acctCentralPage = Services.prefs.getComplexValue(
       prefName,
       Ci.nsIPrefLocalizedString
     ).data;