Skip to content

Commit

Permalink
Fixes LATITUDE-LLM-APP-8A ? (#648)
Browse files Browse the repository at this point in the history
  • Loading branch information
neoxelox authored Nov 20, 2024
1 parent 955aeec commit 728f653
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@ export async function generateMetadata(
},
parent: ResolvingMetadata,
) {
// Wait for parent metadata to resolve to ensure auth middleware is executed
const parentMetadata = await parent

const { datasetId } = await params

try {
const dataset = await getDatasetCached(datasetId)

return buildMetatags({
title: `${dataset.name} (preview)`,
parent: await parent,
parent: parentMetadata,
})
} catch (error) {
if (error instanceof NotFoundError) return notFound()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@ export async function generateMetadata(
},
parent: ResolvingMetadata,
) {
// Wait for parent metadata to resolve to ensure auth middleware is executed
const parentMetadata = await parent

const { evaluationUuid } = await params

try {
const evaluation = await getEvaluationByUuidCached(evaluationUuid)

return buildMetatags({
title: evaluation.name,
parent: await parent,
parent: parentMetadata,
})
} catch (error) {
if (error instanceof NotFoundError) return notFound()
Expand Down
5 changes: 4 additions & 1 deletion apps/web/src/app/(private)/projects/[projectId]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ export async function generateMetadata(
},
parent: ResolvingMetadata,
) {
// Wait for parent metadata to resolve to ensure auth middleware is executed
const parentMetadata = await parent

const { projectId } = await params

try {
Expand All @@ -26,7 +29,7 @@ export async function generateMetadata(

return buildMetatags({
title: project.name,
parent: await parent,
parent: parentMetadata,
})
} catch (error) {
if (error instanceof NotFoundError) return notFound()
Expand Down

0 comments on commit 728f653

Please sign in to comment.