From b30c4d048416adea51966e1a61eb49be272bb358 Mon Sep 17 00:00:00 2001 From: jnsdls Date: Wed, 13 Nov 2024 18:42:44 +0000 Subject: [PATCH] [Dashboard] Fix: Handle null publisher profile (#5372) --- .../(dashboard)/profile/[addressOrEns]/ProfileUI.tsx | 12 ++++++++---- .../app/(dashboard)/profile/[addressOrEns]/page.tsx | 4 ---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/dashboard/src/app/(dashboard)/profile/[addressOrEns]/ProfileUI.tsx b/apps/dashboard/src/app/(dashboard)/profile/[addressOrEns]/ProfileUI.tsx index 22cefdb784f..4747892fe29 100644 --- a/apps/dashboard/src/app/(dashboard)/profile/[addressOrEns]/ProfileUI.tsx +++ b/apps/dashboard/src/app/(dashboard)/profile/[addressOrEns]/ProfileUI.tsx @@ -13,7 +13,7 @@ import { PublishedContracts } from "./components/published-contracts"; export function ProfileUI(props: { profileAddress: string; ensName: string | undefined; - publisherProfile: ProfileMetadata; + publisherProfile: ProfileMetadata | null; showEditProfile: boolean; }) { const { profileAddress, ensName, publisherProfile, showEditProfile } = props; @@ -34,21 +34,25 @@ export function ProfileUI(props: { {displayName} - {publisherProfile.bio && ( + {publisherProfile?.bio && (

{publisherProfile.bio}

)}
- + {publisherProfile && ( + + )}
{showEditProfile && (
- + {publisherProfile && ( + + )}
)} diff --git a/apps/dashboard/src/app/(dashboard)/profile/[addressOrEns]/page.tsx b/apps/dashboard/src/app/(dashboard)/profile/[addressOrEns]/page.tsx index b94cf5f50d1..300d8a19dd3 100644 --- a/apps/dashboard/src/app/(dashboard)/profile/[addressOrEns]/page.tsx +++ b/apps/dashboard/src/app/(dashboard)/profile/[addressOrEns]/page.tsx @@ -26,10 +26,6 @@ export default async function Page(props: PageProps) { resolvedInfo.address, ).catch(() => null); - if (!publisherProfile) { - return notFound(); - } - return (