fix(home): accept an absent vimshottari layer where the type already allowed one
Independent Staging Quality Gate / validate (push) Successful in 11m12s
Independent Staging Quality Gate / publish (push) Successful in 12m11s

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 <cursoragent@cursor.com>
This commit is contained in:
Jesse_Chen
2026-08-18 20:56:06 +08:00
parent ff70ba87b0
commit 0c4134d1eb
+1 -1
View File
@@ -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}大运里适合先把一件小事做完。`