From 0c4134d1eb49993a021eb9876e0e2da45582225a Mon Sep 17 00:00:00 2001 From: Jesse_Chen Date: Tue, 18 Aug 2026 20:56:06 +0800 Subject: [PATCH] fix(home): accept an absent vimshottari layer where the type already allowed one The evidence field is optional, so reading the mahadasha through it yields undefined as well as null, which the lookup did not accept. staging's typecheck was failing on this before this branch touched it. Co-authored-by: Cursor --- frontend/src/lib/daily-starlanguage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/lib/daily-starlanguage.ts b/frontend/src/lib/daily-starlanguage.ts index 466b8d32..6e48f64d 100644 --- a/frontend/src/lib/daily-starlanguage.ts +++ b/frontend/src/lib/daily-starlanguage.ts @@ -291,7 +291,7 @@ function moonHouse(evidence: DailyStarlanguageEvidence): number | null { export function composeDailyStarlanguageCard(evidence: DailyStarlanguageEvidence): DailyStarlanguageCard { const house = moonHouse(evidence); const theme = house ? HOUSE_THEMES[house] : undefined; - const mahadasha = planetZh(evidence.vimshottari?.mahadasha); + const mahadasha = planetZh(evidence.vimshottari?.mahadasha ?? null); const triggers = evidence.transit?.totalTriggers ?? 0; const trend = theme && mahadasha ? `今天${theme.theme}的节奏更明显,${mahadasha}大运里适合先把一件小事做完。`