Skip to content

Commit 1a22466

Browse files
committed
fix delete user boolean logic
1 parent 4eaac8b commit 1a22466

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/ui/members/member-card.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ export function MemberCard({
6161

6262
// Check if current user is a coach in any of this user's relationships
6363
// and make sure we can't delete ourselves. Admins can delete any user.
64-
const canDeleteUser = userRelationships?.some(
64+
const canDeleteUser = (userRelationships?.some(
6565
(rel) => rel.coach_id === userSession.id && userId !== userSession.id
66-
) || (userSession.role === Role.Admin && userSession.id !== userId);
66+
) || (userSession.role === Role.Admin)) && userSession.id !== userId;
6767

6868
const handleDelete = async () => {
6969
if (!confirm("Are you sure you want to delete this member?")) {

0 commit comments

Comments
 (0)