diff --git a/app/(main)/dashboard/settings/page.tsx b/app/(main)/dashboard/settings/page.tsx index 4d05ae3..3099b30 100644 --- a/app/(main)/dashboard/settings/page.tsx +++ b/app/(main)/dashboard/settings/page.tsx @@ -5,7 +5,7 @@ import { Input } from "@/components/ui/input"; import { api } from "@/convex/_generated/api"; import useApiMutation from "@/lib/hooks/use-api-mutation"; import { useQuery } from "convex/react"; -import { Copy, RefreshCcw, Trash } from "lucide-react"; +import { Copy, Loader2, RefreshCcw, Trash } from "lucide-react"; import { toast } from "sonner"; const AccountSettingsPage = () => { @@ -38,6 +38,8 @@ const AccountSettingsPage = () => { .catch(() => toast.error("Failed to revoke API key")); }; + if (existingAPIKey === undefined) return ; + return ( <> {existingAPIKey ? ( diff --git a/app/api/webhooks/clerk/utils/organization.ts b/app/api/webhooks/clerk/utils/organization.ts index 2f5fbbc..8f879a4 100644 --- a/app/api/webhooks/clerk/utils/organization.ts +++ b/app/api/webhooks/clerk/utils/organization.ts @@ -33,7 +33,7 @@ function mapOrgJsonToOrg(orgJson: OrganizationJSON): Organization { return { clerkId: orgJson.id, name: orgJson.name, - imageUrl: orgJson.image_url, + imageUrl: orgJson.image_url || "", createdBy: orgJson.created_by, }; }