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 <cursoragent@cursor.com>
This commit is contained in:
@@ -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}大运里适合先把一件小事做完。`
|
||||
|
||||
Reference in New Issue
Block a user