mirror of https://github.com/zulip/zulip.git
user-groups: Update user_group_name_dict, when name/description is edited.
We do not update user_group_name_dict when name or description is edited, which may lead to errors if get_user_group_from_name is called, so to fix that we update user_group_name_dict also.
This commit is contained in:
parent
5c1858e584
commit
dafaf28099
|
@ -39,9 +39,13 @@ exports.update = function (event) {
|
||||||
var group = exports.get_user_group_from_id(event.group_id);
|
var group = exports.get_user_group_from_id(event.group_id);
|
||||||
if (event.data.name !== undefined) {
|
if (event.data.name !== undefined) {
|
||||||
group.name = event.data.name;
|
group.name = event.data.name;
|
||||||
|
user_group_name_dict.del(group.name);
|
||||||
|
user_group_name_dict.set(group.name, group);
|
||||||
}
|
}
|
||||||
if (event.data.description !== undefined) {
|
if (event.data.description !== undefined) {
|
||||||
group.description = event.data.description;
|
group.description = event.data.description;
|
||||||
|
user_group_name_dict.del(group.name);
|
||||||
|
user_group_name_dict.set(group.name, group);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue