mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-21 16:18:28 +01:00
Fix groups modal not loading if admin access restricted (#9182)
This commit is contained in:
parent
6ab7336c21
commit
0812f00d24
@ -273,12 +273,13 @@ export class GroupAddEditComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
// If the current user is not already in the group and cannot add themselves, remove them from the list
|
// If the current user is not already in the group and cannot add themselves, remove them from the list
|
||||||
if (restrictGroupAccess) {
|
if (restrictGroupAccess) {
|
||||||
const organizationUserId = this.members.find((m) => m.userId === activeAccount.id).id;
|
// organizationUserId may be null if accessing via a provider
|
||||||
|
const organizationUserId = this.members.find((m) => m.userId === activeAccount.id)?.id;
|
||||||
const isAlreadyInGroup = this.groupForm.value.members.some(
|
const isAlreadyInGroup = this.groupForm.value.members.some(
|
||||||
(m) => m.id === organizationUserId,
|
(m) => m.id === organizationUserId,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!isAlreadyInGroup) {
|
if (organizationUserId != null && !isAlreadyInGroup) {
|
||||||
this.members = this.members.filter((m) => m.id !== organizationUserId);
|
this.members = this.members.filter((m) => m.id !== organizationUserId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user