Skip to content

Commit ecee31a

Browse files
Merge branch 'main' into alexcarpenter/user-2201-add-color-mix-utilities
2 parents 97e6456 + 1e737c7 commit ecee31a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.changeset/yummy-laws-hunt.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/clerk-js': patch
3+
---
4+
5+
Hide invitation in `OrganizationSwitcher` when user is already an active member of the organization

packages/clerk-js/src/ui/components/OrganizationSwitcher/UserInvitationSuggestionList.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,10 @@ const InvitationPreview = withCardStateProvider(
168168
};
169169

170170
if (status === 'accepted') {
171-
if (acceptedOrganization?.id && activeOrganization?.id === acceptedOrganization.id) {
171+
if (
172+
invitation.publicOrganizationData.id === activeOrganization?.id ||
173+
(acceptedOrganization?.id && activeOrganization?.id === acceptedOrganization.id)
174+
) {
172175
// Hide the Accepted invitation that looks like a membership when the organization is already active
173176
return null;
174177
}

0 commit comments

Comments
 (0)