diff --git a/packages/clerk-js/src/ui/components/OrganizationProfile/AddDomainPage.tsx b/packages/clerk-js/src/ui/components/OrganizationProfile/AddDomainPage.tsx index cbc202861ad..472b12fd97c 100644 --- a/packages/clerk-js/src/ui/components/OrganizationProfile/AddDomainPage.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationProfile/AddDomainPage.tsx @@ -26,7 +26,7 @@ export const AddDomainPage = withCardStateProvider(() => { return null; } - const canSubmit = organization.name !== nameField.value; + const canSubmit = nameField.value.trim() !== ''; const onSubmit = (e: React.FormEvent) => { nameField.setError(undefined); diff --git a/packages/clerk-js/src/ui/components/OrganizationProfile/RequestToJoinList.tsx b/packages/clerk-js/src/ui/components/OrganizationProfile/RequestToJoinList.tsx index d78a6e3d0f7..1ec22ef807a 100644 --- a/packages/clerk-js/src/ui/components/OrganizationProfile/RequestToJoinList.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationProfile/RequestToJoinList.tsx @@ -7,12 +7,14 @@ import { handleError } from '../../utils'; import { DataTable, RowContainer } from './MemberListTable'; const ITEMS_PER_PAGE = 10; + +const membershipRequestsParams = { + pageSize: ITEMS_PER_PAGE, +}; export const RequestToJoinList = () => { const card = useCardState(); const { organization, membershipRequests } = useCoreOrganization({ - membershipRequests: { - pageSize: ITEMS_PER_PAGE, - }, + membershipRequests: membershipRequestsParams, }); if (!organization) { @@ -47,26 +49,24 @@ const RequestRow = withCardStateProvider( (props: { request: OrganizationMembershipRequestResource; onError: ReturnType['setError'] }) => { const { request, onError } = props; const card = useCardState(); - const { membershipRequests } = useCoreOrganization(); - - const mutateSwrState = () => { - const unstable__mutate = (membershipRequests as any).unstable__mutate; - if (unstable__mutate && typeof unstable__mutate === 'function') { - unstable__mutate(); - } - }; + const { membershipRequests } = useCoreOrganization({ + membershipRequests: membershipRequestsParams, + }); const onAccept = () => { return card - .runAsync(request.accept, 'accept') - .then(mutateSwrState) + .runAsync(async () => { + await request.accept(); + await (membershipRequests as any).unstable__mutate?.(); + }, 'accept') .catch(err => handleError(err, [], onError)); }; - const onReject = () => { return card - .runAsync(request.reject, 'reject') - .then(mutateSwrState) + .runAsync(async () => { + await request.reject(); + await (membershipRequests as any).unstable__mutate?.(); + }, 'reject') .catch(err => handleError(err, [], onError)); }; diff --git a/packages/localizations/src/en-US.ts b/packages/localizations/src/en-US.ts index 9e29c8d3e51..c9a12b4c3d8 100644 --- a/packages/localizations/src/en-US.ts +++ b/packages/localizations/src/en-US.ts @@ -587,9 +587,9 @@ export const enUS: LocalizationResource = { }, }, createDomainPage: { - title: 'Add email domain', + title: 'Add domain', subtitle: - 'Add the email domain to verify. Users with email addresses at this domain can join the organization automatically or request to join.', + 'Add the domain to verify. Users with email addresses at this domain can join the organization automatically or request to join.', }, verifyDomainPage: { title: 'Verify domain',