Fix: Geburtstags-Banner nur für aktiven Hund

bday/bdayYear: nur truthy wenn bdayDog.id === dog.id (aktiver Hund)
otherBdayDog: zeigt Hinweis wenn ein ANDERER Hund Geburtstag hat
SW by-v1031, APP_VER 1031
This commit is contained in:
rene 2026-05-16 12:13:15 +02:00
parent a50158d522
commit fc8d396247
4 changed files with 7 additions and 6 deletions

View file

@ -3,7 +3,7 @@
Router, State-Management, Navigation, Initialisierung.
============================================================ */
const APP_VER = '1030'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
const APP_VER = '1031'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
const APP_VERSION = '1.6.0'; // ← semantische Version, wird bei make release gesetzt
const IS_STAGING = location.hostname === 'staging.banyaro.app';
// Cache-Bust-Parameter nach Update-Reload sofort entfernen

View file

@ -1384,10 +1384,11 @@ window.Worlds = (() => {
return null;
}
const bdayDog = _dogs.find(d => _birthdayState(d.geburtstag)) || null;
const bday = bdayDog ? _birthdayState(bdayDog.geburtstag) : null;
const bdayYear = bdayDog?.geburtstag ? new Date().getFullYear() - parseInt(bdayDog.geburtstag.slice(0, 4)) : null;
// Großes Banner nur wenn der AKTIVE Hund Geburtstag hat
const bday = (bdayDog && bdayDog.id === dog.id) ? _birthdayState(dog.geburtstag) : null;
const bdayYear = bday && dog.geburtstag ? new Date().getFullYear() - parseInt(dog.geburtstag.slice(0, 4)) : null;
// Merken ob ein anderer Hund Geburtstag hat (für Info-Karte unten)
// Hinweis in Info-Karte wenn ein ANDERER Hund Geburtstag hat
const otherBdayDog = (bdayDog && bdayDog.id !== dog.id) ? bdayDog : null;
const [streakRes, diaryRes] = await Promise.allSettled([