mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-13 10:53:18 +00:00
Don't allow duplicate GCS folder names
This commit is contained in:
@@ -581,15 +581,16 @@
|
||||
* @returns a promise of the HTTP operation
|
||||
*/
|
||||
AddressBook.prototype.$rename = function(name) {
|
||||
var i, list;
|
||||
var _this = this, i, list;
|
||||
|
||||
list = this.isSubscription? AddressBook.$subscriptions : AddressBook.$addressbooks;
|
||||
i = _.indexOf(_.map(list, 'id'), this.id);
|
||||
this.name = name;
|
||||
list.splice(i, 1);
|
||||
AddressBook.$add(this);
|
||||
|
||||
return this.$save();
|
||||
return this.$save().then(function() {
|
||||
list.splice(i, 1);
|
||||
_this.name = name;
|
||||
AddressBook.$add(_this);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user