Refine team API keys and member invitation sections.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Developing-Gamer 2026-05-27 13:35:41 -07:00
parent 35b1ab6e90
commit 4ec328066c
2 changed files with 4 additions and 3 deletions

View File

@ -13,13 +13,13 @@ export function TeamApiKeysSection(props: { team: Team }) {
const team = user.useTeam(props.team.id);
const stackApp = useStackApp();
const project = stackApp.useProject();
const manageApiKeysPermission = user.usePermission(props.team, '$manage_api_keys');
if (!team) {
throw new HexclaveAssertionError("Team not found");
}
const teamApiKeysEnabled = project.config.allowTeamApiKeys;
const manageApiKeysPermission = user.usePermission(props.team, '$manage_api_keys');
if (!manageApiKeysPermission || !teamApiKeysEnabled) {
return null;
}

View File

@ -75,7 +75,7 @@ function MemberInvitationsSectionInvitationsList(props: { team: Team }) {
<TableCell className="py-3 px-4 text-right">
{removeMemberPermission && (
<Button
onClick={async () => await invitation.revoke()}
onClick={async () => { await invitation.revoke(); }}
size="icon"
variant="ghost"
className="h-8 w-8 text-muted-foreground hover:text-red-500 hover:bg-zinc-100 dark:hover:bg-zinc-900 rounded-lg transition-colors"
@ -107,6 +107,7 @@ function MemberInvitationSectionInner(props: { team: Team }) {
});
const [loading, setLoading] = useState(false);
const [invitedEmail, setInvitedEmail] = useState<string | null>(null);
const watchedEmail = watch('email');
const onSubmit = async (data: yup.InferType<typeof invitationSchema>) => {
setLoading(true);
@ -121,7 +122,7 @@ function MemberInvitationSectionInner(props: { team: Team }) {
useEffect(() => {
setInvitedEmail(null);
}, [watch('email')]);
}, [watchedEmail]);
return (
<>