(js) Error handling when renaming a mailbox

pull/221/head
Francis Lachapelle 2016-09-07 16:44:11 -04:00
parent 2040706432
commit 6dc2078c38
2 changed files with 16 additions and 5 deletions

1
NEWS
View File

@ -14,6 +14,7 @@ Bug fixes
- [eas] properly escape all email and address fields
- [web] restored functionality to save unknown recipient emails to address book on send
- [web] fixed ripple blocking the form when submitting no values (#3808)
- [web] fixed error handling when renaming a mailbox
- [core] strip protocol value from proxyAddresses attribute (#3182)
3.1.5 (2016-08-10)

View File

@ -732,10 +732,8 @@
*/
Mailbox.prototype.$reset = function() {
var _this = this;
angular.forEach(this, function(value, key) {
if (key != 'constructor' && key != 'children' && key[0] != '$') {
delete _this[key];
}
angular.forEach(this.$shadowData, function(value, key) {
delete _this[key];
});
angular.extend(this, this.$shadowData);
this.$shadowData = this.$omit();
@ -759,6 +757,7 @@
Mailbox.$log.error(JSON.stringify(response.data, undefined, 2));
// Restore previous version
_this.$reset();
return response.data;
});
};
@ -779,7 +778,18 @@
* @return an object literal copy of the Mailbox instance
*/
Mailbox.prototype.$omit = function() {
return { name: this.name };
var mailbox = {};
angular.forEach(this, function(value, key) {
if (key != 'constructor' &&
key != 'children' &&
key != 'headers' &&
key != 'uids' &&
key != 'uidsMap' &&
key[0] != '$') {
mailbox[key] = value;
}
});
return mailbox;
};
/**