mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-19 21:53:19 +00:00
(fix) moved the mailbox cleanup after expunge in the service
This commit is contained in:
@@ -413,7 +413,22 @@
|
||||
* @returns a promise of the HTTP operation
|
||||
*/
|
||||
Mailbox.prototype.$emptyTrash = function() {
|
||||
return Mailbox.$$resource.post(this.id, 'emptyTrash');
|
||||
var _this = this,
|
||||
deferred = Mailbox.$q.defer(),
|
||||
promise;
|
||||
|
||||
promise = Mailbox.$$resource.post(this.id, 'emptyTrash');
|
||||
|
||||
promise.then(function() {
|
||||
// Remove all messages from the mailbox
|
||||
_this.$messages = [];
|
||||
_this.uidsMap = {};
|
||||
_this.unseenCount = 0;
|
||||
}, function(data, status) {
|
||||
deferred.reject(data);
|
||||
});
|
||||
|
||||
return deferred.promise;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -138,10 +138,7 @@
|
||||
|
||||
function emptyTrashFolder(folder) {
|
||||
folder.$emptyTrash().then(function() {
|
||||
// Success - remove all messages from the mailbox
|
||||
folder.$messages = [];
|
||||
folder.uidsMap = {};
|
||||
folder.unseenCount = 0;
|
||||
// Success
|
||||
}, function(error) {
|
||||
Dialog.alert(l('Warning'), error);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user