user_groups: Fix live-update of data when renaming groups.

The "user_group_name_dict" value for the old group name key
was not deleted and this led to a bug where the stream creation
UI was incorrectly showing about a user group already existing
with the old group name.

Fixes #28108.
This commit is contained in:
Sahil Batra
2023-12-10 13:13:23 +05:30
committed by Tim Abbott
parent ce56e19d1c
commit 9fd5ed27fe
2 changed files with 2 additions and 2 deletions

View File

@@ -69,8 +69,8 @@ export function get_user_group_from_id(group_id: number): UserGroup {
export function update(event: UserGroupUpdateEvent): void {
const group = get_user_group_from_id(event.group_id);
if (event.data.name !== undefined) {
group.name = event.data.name;
user_group_name_dict.delete(group.name);
group.name = event.data.name;
user_group_name_dict.set(group.name, group);
}
if (event.data.description !== undefined) {