From 194f6d585a3a590c81a10250dc45cdee4686ea06 Mon Sep 17 00:00:00 2001 From: Akshita Goyal <36129505+gakshita@users.noreply.github.com> Date: Fri, 28 Feb 2025 12:08:18 +0530 Subject: [PATCH] fix: handled undefined title for intake tab title (#2613) --- space/app/intake/[anchor]/layout.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/space/app/intake/[anchor]/layout.tsx b/space/app/intake/[anchor]/layout.tsx index cc1a5d3713..e52d61e4e4 100644 --- a/space/app/intake/[anchor]/layout.tsx +++ b/space/app/intake/[anchor]/layout.tsx @@ -16,11 +16,12 @@ export async function generateMetadata({ params }: Props) { try { const response = await fetch(`${process.env.NEXT_PUBLIC_API_BASE_URL}/api/public/anchor/${anchor}/intake/meta/`); const data = await response.json(); + return { - title: `${data?.name} - Intake` || DEFAULT_TITLE, + title: `${data?.name || DEFAULT_TITLE} - Intake`, description: DEFAULT_DESCRIPTION, openGraph: { - title: `${data?.name} - Intake` || DEFAULT_TITLE, + title: `${data?.name || DEFAULT_TITLE} - Intake`, description: DEFAULT_DESCRIPTION, type: "website", images: [ @@ -34,7 +35,7 @@ export async function generateMetadata({ params }: Props) { }, twitter: { card: "summary_large_image", - title: `${data?.name} - Intake` || DEFAULT_TITLE, + title: `${data?.name || DEFAULT_TITLE} - Intake`, description: data?.description || DEFAULT_DESCRIPTION, images: [data?.cover_image], },