Bug 1364167 - When repairing a folder only re-display it if it is the current one. r+a=jorgk
authorGeoff Lankow <geoff@darktrojan.net>
Tue, 12 Nov 2019 21:20:04 +1300
changeset 36410 8d03e8719bd7868586632ab3ce82e1041fff90fa
parent 36409 89c74493e695121bf9c83bb29252328bdbedf633
child 36411 216e79bcfb3ffdb15169f9445b2fe2de00926e3e
push id2526
push usermozilla@jorgk.com
push dateWed, 13 Nov 2019 09:10:23 +0000
treeherdercomm-beta@216e79bcfb3f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1364167
Bug 1364167 - When repairing a folder only re-display it if it is the current one. r+a=jorgk
mail/base/content/folderPane.js
--- a/mail/base/content/folderPane.js
+++ b/mail/base/content/folderPane.js
@@ -2934,17 +2934,19 @@ var gFolderTreeController = {
         // Remove the offline store, if any.
         let offlineStore = folder.filePath;
         // XXX todo: figure out how to delete a maildir directory async. This
         // delete causes main thread lockup for large maildir folders.
         if (offlineStore.exists()) {
           offlineStore.remove(true);
         }
       }
-      gFolderDisplay.view.close();
+      if (gFolderDisplay.displayedFolder == folder) {
+        gFolderDisplay.view.close();
+      }
 
       // Send a notification that we are triggering a database rebuild.
       MailServices.mfn.notifyItemEvent(
         folder,
         "FolderReindexTriggered",
         null,
         null
       );
@@ -2955,17 +2957,19 @@ var gFolderTreeController = {
       msgDB.summaryValid = false;
       try {
         folder.closeAndBackupFolderDB("");
       } catch (e) {
         // In a failure, proceed anyway since we're dealing with problems
         folder.ForceDBClosed();
       }
       folder.updateFolder(msgWindow);
-      gFolderDisplay.show(folder);
+      if (gFolderDisplay.displayedFolder == folder) {
+        gFolderDisplay.show(folder);
+      }
     }
 
     window.openDialog(
       "chrome://messenger/content/folderProps.xul",
       "",
       "chrome,modal,centerscreen",
       {
         folder,