update text and now panel
This commit is contained in:
@@ -27,6 +27,18 @@
|
||||
let moonCountdownCache = null;
|
||||
let decanCountdownCache = null;
|
||||
|
||||
function joinSabianPhrases(phrases) {
|
||||
const parts = (Array.isArray(phrases) ? phrases : [])
|
||||
.map((phrase) => String(phrase || "").trim())
|
||||
.filter(Boolean);
|
||||
|
||||
if (!parts.length) {
|
||||
return "--";
|
||||
}
|
||||
|
||||
return parts.join(" ");
|
||||
}
|
||||
|
||||
function renderNowStatsFromSnapshot(elements, stats) {
|
||||
if (elements.nowStatsPlanetsEl) {
|
||||
elements.nowStatsPlanetsEl.replaceChildren();
|
||||
@@ -47,13 +59,10 @@
|
||||
if (elements.nowStatsSabianEl) {
|
||||
const sunSabianSymbol = stats?.sunSabianSymbol || null;
|
||||
const moonSabianSymbol = stats?.moonSabianSymbol || null;
|
||||
const sunLine = sunSabianSymbol?.phrase
|
||||
? `Sun Sabian ${sunSabianSymbol.absoluteDegree}: ${sunSabianSymbol.phrase}`
|
||||
: "Sun Sabian: --";
|
||||
const moonLine = moonSabianSymbol?.phrase
|
||||
? `Moon Sabian ${moonSabianSymbol.absoluteDegree}: ${moonSabianSymbol.phrase}`
|
||||
: "Moon Sabian: --";
|
||||
elements.nowStatsSabianEl.textContent = `${sunLine}\n${moonLine}`;
|
||||
elements.nowStatsSabianEl.textContent = joinSabianPhrases([
|
||||
moonSabianSymbol?.phrase,
|
||||
sunSabianSymbol?.phrase
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user