Skip to content

Commit

Permalink
Fix selectMemberRoles
Browse files Browse the repository at this point in the history
  • Loading branch information
mnmsvlw committed Jan 23, 2025
1 parent 88b0dac commit 8ca65f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ui/src/store/groups/groups.selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const selectIsGroupUpdating = (state: AppState) => selectRootState(state)
export const selectMemberRoles = createSelector(
[selectEditingGroupId, (state: AppState) => state, selectSelf],
(editingGroupId, state, currentUser) => {
const groupMembers = editingGroupId !== null ? selectGroupMembersByGroupId(editingGroupId)(state) : [];
const groupMembers = selectGroupMembersByGroupId(Number(editingGroupId))(state) || [];
const isAdmin = groupMembers.find(member => member.user.id === currentUser?.id)?.role === USER_ROLES.ADMIN;
const hasTwoAdmins = groupMembers.filter(member => member.role === USER_ROLES.ADMIN).length >= 2;

Expand Down

0 comments on commit 8ca65f8

Please sign in to comment.