Bug 1364167 - When repairing a folder only re-display it if it is the current one. r=jorgk
authorGeoff Lankow <geoff@darktrojan.net>
Tue, 12 Nov 2019 21:20:04 +1300
changeset 37499 42e6d3683bdabc3b1f2b71907b432e677bd079ac
parent 37498 ae4432bce46637257fc147f26d75c5c9c5d1c886
child 37500 716cec9c6ca52060ea9fc237f6f266d3ac16ddf7
push id396
push userclokep@gmail.com
push dateMon, 06 Jan 2020 23:11:57 +0000
reviewersjorgk
bugs1364167
Bug 1364167 - When repairing a folder only re-display it if it is the current one. r=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,