fix(mail(js)): force search when restoring mailbox during navigation

This commit is contained in:
Francis Lachapelle
2021-10-14 14:32:16 -04:00
parent fa68c864f1
commit 0eb452c412
3 changed files with 14 additions and 3 deletions
@@ -868,13 +868,18 @@
* @memberof Mailbox.prototype
* @desc Reset the original state the mailbox's data.
*/
Mailbox.prototype.$reset = function() {
Mailbox.prototype.$reset = function(options) {
var _this = this;
angular.forEach(this.$shadowData, function(value, key) {
delete _this[key];
});
angular.extend(this, this.$shadowData);
this.$shadowData = this.$omit();
if (options && options.filter) {
this.$messages = [];
this.$visibleMessages = [];
delete this.$syncToken;
}
};
/**
@@ -53,8 +53,14 @@
title += ' | ' + defaultWindowTitle;
$window.document.title = title;
});
};
$scope.$on('$destroy', function() {
if (vm.mode.search) {
vm.mode.search = false;
vm.selectedFolder.$reset({ filter: true });
}
});
};
function _registerHotkeys(keys) {
keys.push(sgHotkeys.createHotkey({