diff --git a/mail/base/content/commandglue.js b/mail/base/content/commandglue.js index 215366498c6c..a6e54d9b658e 100644 --- a/mail/base/content/commandglue.js +++ b/mail/base/content/commandglue.js @@ -1147,7 +1147,7 @@ function CreateGroupedSearchTerms(searchTermsArray) return searchTermsArrayForQS; } -var gViewDebug = true; +var gViewDebug = false; function viewDebug(str) { diff --git a/mail/base/content/searchBar.js b/mail/base/content/searchBar.js index 6732f20092e5..24d1298a6d13 100644 --- a/mail/base/content/searchBar.js +++ b/mail/base/content/searchBar.js @@ -121,6 +121,10 @@ var gSearchNotificationListener = var msgdb = vFolder.getMsgDatabase(msgWindow); msgdb.Commit(MSG_DB_LARGE_COMMIT); + // load the last used mail view for the folder... + var result = dbFolderInfo.getUint32Property("current-view", 0); + ViewChangeByValue(result); + // now that we have finished loading a virtual folder, scroll to the correct message ScrollToMessageAfterFolderLoad(vFolder); } @@ -618,6 +622,11 @@ function Search(str) // from FolderLoaded in order to avoid moving focus into the search bar. function loadVirtualFolder() { + // bit of a hack...if the underlying real folder is loaded with the same view value + // as the value for the virtual folder being searched, then ViewChangeByValue + // fails to change the view because it thinks the view is already correctly loaded. + // so set gCurrentViewValue back to All. + gCurrentViewValue = 0; onEnterInSearchBar(); }