fix(koja): default to fa (no browser locale guess); guard null discoverProfile
Koja auto-detected locale from the browser Accept-Language (en for many Persian users); set localeDetection:false so locale-less URLs default to fa. Also guarded cafe.discoverProfile across the cafe page, cafe card, and JSON-LD — a café without a discover profile crashed the page (500). The cafe page now resolves the café first and notFound()s an unknown slug before fetching menu/reviews. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -46,11 +46,11 @@ export function CafeJsonLd({ cafe, locale, baseUrl }: Props) {
|
||||
worstRating: "1",
|
||||
},
|
||||
} : {}),
|
||||
...(cafe.discoverProfile.themes.length ? {
|
||||
...(cafe.discoverProfile?.themes?.length ? {
|
||||
servesCuisine: cafe.discoverProfile.themes,
|
||||
} : {}),
|
||||
priceRange: (() => {
|
||||
const tier = cafe.discoverProfile.priceTier;
|
||||
const tier = cafe.discoverProfile?.priceTier;
|
||||
if (tier === "budget") return "﷼";
|
||||
if (tier === "moderate") return "﷼﷼";
|
||||
if (tier === "upscale") return "﷼﷼﷼";
|
||||
|
||||
Reference in New Issue
Block a user