mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 22:43:42 +00:00
group-settings: Live update membership status text on subgroup update.
This commit adds code to live update the membership status text if subgroups of a group, either the active group or one of the subgroup of active group. Fixes #32485.
This commit is contained in:
@@ -434,6 +434,19 @@ export function is_user_in_group(
|
||||
return false;
|
||||
}
|
||||
|
||||
export function is_user_in_any_group(
|
||||
user_group_ids: number[],
|
||||
user_id: number,
|
||||
direct_member_only = false,
|
||||
): boolean {
|
||||
for (const group_id of user_group_ids) {
|
||||
if (is_user_in_group(group_id, user_id, direct_member_only)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
export function get_associated_subgroups(user_group: UserGroup, user_id: number): UserGroup[] {
|
||||
const subgroup_ids = get_recursive_subgroups(user_group)!;
|
||||
if (subgroup_ids === undefined) {
|
||||
|
||||
Reference in New Issue
Block a user