Fixed group list not updating when adding/deleting a group

This commit is contained in:
skjnldsv 2016-04-11 04:53:51 +02:00
parent 870bdc9b92
commit 8ceca17efa
2 changed files with 10 additions and 0 deletions

View File

@ -14,6 +14,15 @@ angular.module('contactsApp')
return $routeParams.gid;
};
// Update groupList on contact add/delete/update
ContactService.registerObserverCallback(function() {
$scope.$apply(function() {
ContactService.getGroups().then(function(groups) {
ctrl.groups = _.unique(initialGroups.concat(groups));
});
});
});
ctrl.setSelected = function (selectedGroup) {
SearchService.cleanSearch();
$routeParams.gid = selectedGroup;

View File

@ -146,6 +146,7 @@ angular.module('contactsApp')
return DavClient.updateCard(contact.data, {json: true}).then(function(xhr) {
var newEtag = xhr.getResponseHeader('ETag');
contact.setETag(newEtag);
notifyObservers('update', contact.uid());
});
};