From cfbb997d036f376ed103fd0df00c9c8091fd614c Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Thu, 21 Aug 2014 15:31:02 +0000 Subject: [PATCH] Backport commit r48111, committed by Nathan Gray. When moving mail, remove any cache for target directory --- mail/js/app.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/mail/js/app.js b/mail/js/app.js index f80a2eefde..649cf1f7a1 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -2748,6 +2748,21 @@ app.classes.mail = AppJS.extend( var target = _action.id == 'drop_move_mail' ? _target.iface.id : _action.id.substr(5); var messages = this.mail_getFormData(_senders); if (typeof _allMessagesChecked=='undefined') _allMessagesChecked=false; + + // Directly delete any cache for target + if(window.localStorage) + { + for(var i = 0; i < window.localStorage.length; i++) + { + var key = window.localStorage.key(i); + + // Find directly by what the key would look like + if(key.indexOf('cached_fetch_mail::{"selectedFolder":"'+_target.id+'"') == 0) + { + window.localStorage.removeItem(key); + } + } + } // TODO: Write move/copy function which cares about doing the same stuff // as the "onNodeSelect" function! messages['all'] = _allMessagesChecked;