From 07949c88916b3aea8873ab413df3c613fbc1cdff Mon Sep 17 00:00:00 2001 From: Vignesh Gupta Date: Tue, 11 Jun 2024 13:01:47 +0530 Subject: [PATCH] fix(organization): :alien: fix ci issue due to clerk upgrade --- app/(main)/dashboard/settings/page.tsx | 4 +++- app/api/webhooks/clerk/utils/organization.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) 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, }; }