summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorskjnldsv <fremulon@protonmail.com>2016-04-11 04:53:51 +0200
committerskjnldsv <fremulon@protonmail.com>2016-04-11 04:53:51 +0200
commit8ceca17efaac42e4b343394cc59c75da259569db (patch)
tree9b905e990ae96ae6e90e2591a838e6bf51f7576e /js
parent870bdc9b925aaa64ee9cb9943fc6aad075d37c8b (diff)
Fixed group list not updating when adding/deleting a group
Diffstat (limited to 'js')
-rw-r--r--js/components/groupList/groupList_controller.js9
-rw-r--r--js/services/contact_service.js1
2 files changed, 10 insertions, 0 deletions
diff --git a/js/components/groupList/groupList_controller.js b/js/components/groupList/groupList_controller.js
index 33aae4a7..92548017 100644
--- a/js/components/groupList/groupList_controller.js
+++ b/js/components/groupList/groupList_controller.js
@@ -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;
diff --git a/js/services/contact_service.js b/js/services/contact_service.js
index 1511027c..76e7052b 100644
--- a/js/services/contact_service.js
+++ b/js/services/contact_service.js
@@ -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());
});
};