Bug 1568440 - Prevent Account Central loading again if it is already loading or loaded. r=jorgk DONTBUILD
authorGeoff Lankow <geoff@darktrojan.net>
Wed, 24 Jul 2019 20:13:20 +1200
changeset 76414 bec4c1774b736a6f7fc62a7f3f5c75a924f17b5f
parent 76308 25fcc2cfed1ac96e181913def4db5049c8743d7c
child 76415 ce596711000820dab5663c43c21ed4447497450a
child 76417 bbcb49e16fd9584182c9f5b50dba06c8922349da
child 76418 011167f1ac2a0d861f9514df9ef437347f0815f7
child 76419 144c10542db4b3ffe9648772b3f3b67dba783cd1
child 76421 8f944f4966c5bf871b892601ae284d539ab3a005
child 76423 e2dad5423b3ba2aa4742d4f0e74e0a06ebe92291
push id8881
push useralessandro@thunderbird.net
push dateWed, 24 Jul 2019 18:44:13 +0000
treeherdertry-comm-central@09b8f74740e6 [default view] [failures only]
reviewersjorgk
bugs1568440
Bug 1568440 - Prevent Account Central loading again if it is already loading or loaded. r=jorgk DONTBUILD
mail/base/content/folderDisplay.js
--- a/mail/base/content/folderDisplay.js
+++ b/mail/base/content/folderDisplay.js
@@ -1700,21 +1700,23 @@ FolderDisplayWidget.prototype = {
   /**
    * Cause the displayDeck to display the (preference configurable) account
    *  central page.
    */
   _showAccountCentral() {
     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;
-    window.frames.accountCentralPane.location.href = acctCentralPage;
+    // Prevent a second load if necessary.
+    if (window.frames.accountCentralPane.location.href != acctCentralPage) {
+      window.frames.accountCentralPane.location.href = acctCentralPage;
+    }
   },
 
   /**
    * Call this when the tab using us is being hidden.
    */
   makeInactive() {
     // - things to do before we mark ourselves inactive (because they depend on
     //   us being active)