diff --git a/ui/web/src/pages/api-keys/api-key-create-dialog.tsx b/ui/web/src/pages/api-keys/api-key-create-dialog.tsx index a3d0ab0e..002784d1 100644 --- a/ui/web/src/pages/api-keys/api-key-create-dialog.tsx +++ b/ui/web/src/pages/api-keys/api-key-create-dialog.tsx @@ -50,11 +50,9 @@ interface Props { export function ApiKeyCreateDialog({ open, onOpenChange, onCreate }: Props) { const { t } = useTranslation("api-keys"); - const { isOwner, tenants, currentTenantId } = useTenants(); + const { isOwner, currentTenantId, currentTenantName } = useTenants(); - const defaultTenant = isOwner - ? currentTenantId || SYSTEM_TENANT - : SYSTEM_TENANT; + const defaultTenant = currentTenantId || SYSTEM_TENANT; const [name, setName] = useState(""); const [scopes, setScopes] = useState([]); @@ -132,11 +130,11 @@ export function ApiKeyCreateDialog({ open, onOpenChange, onCreate }: Props) { {t("form.tenantSystem")} - {tenants.map((tenant) => ( - - {tenant.name} + {currentTenantId && ( + + {currentTenantName || currentTenantId} - ))} + )}