From cf2bd4fe1b06e6b20fda21e61597a05b57d0e2d2 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Wed, 23 Dec 2009 23:03:53 -0700 Subject: [PATCH] Delete search folders from browser cache when navigating away from them --- imp/js/DimpBase.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/imp/js/DimpBase.js b/imp/js/DimpBase.js index 5ce9b2f53..11c9194d7 100644 --- a/imp/js/DimpBase.js +++ b/imp/js/DimpBase.js @@ -314,6 +314,7 @@ var DimpBase = { loadMailbox: function(f, opts) { + var need_delete; opts = opts || {}; if (!this.viewport) { @@ -328,6 +329,13 @@ var DimpBase = { $('folderName').update(DIMP.text.loading); $('msgHeader').update(); this.folderswitch = true; + + /* Don't cache results of search folders - since we will need + * to grab new copy if we ever return to it. */ + if (this.isSearch(this.folder)) { + need_delete = this.folder; + } + this.folder = f; if (this.isSearch(f) && @@ -338,6 +346,10 @@ var DimpBase = { } this.viewport.loadView(f, { search: (this.uid ? { imapuid: Number(this.uid) } : null), background: opts.background}); + + if (need_delete) { + this.viewport.deleteView(need_delete); + } }, _createViewPort: function() -- 2.11.0