user_groups: Handle add/remove members events.

This fixes the real-time sync for the user groups membership data
structure to work like these work in the rest of Zulip; now, edits
made in one browser are immediately and correctly reflected in other
browsers.
This commit is contained in:
Tim Abbott
2018-03-04 08:39:54 -08:00
parent 0147826042
commit aed8cc9062
4 changed files with 19 additions and 24 deletions

View File

@@ -122,13 +122,6 @@ exports.populate_user_groups = function () {
delete: JSON.stringify(removed),
},
success: function () {
original_group = _.reject(original_group, function (e) {
return removed.includes(e);
});
original_group = original_group.concat(added);
group_data.members = original_group;
user_groups.remove(group_data);
user_groups.add(group_data);
btn.text(i18n.t("Saved!")).delay(200).fadeOut(function () {
$(this).html('<i class="fa fa-check" aria-hidden="true"></i>');
});