From 370ae52138f27423d2c57e937d7db0ad1eb4a46a Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 18 Apr 2026 13:32:58 +0200 Subject: [PATCH] Fix: Header zeigt aktiven Hunde-Namen, Klick navigiert zu Hund-Profil MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - dog-sw-title zeigt dog.name statt hardcoded "Ban Yaro" - Klick auf Namen im Header und Sidebar öffnet Hund-Profil (wie Avatar-Klick) - sidebar-logo-text Handler greift nur noch beim Fallback ohne Hund - SW-Cache by-v198 --- backend/static/js/app.js | 16 +++++++++++----- backend/static/sw.js | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/backend/static/js/app.js b/backend/static/js/app.js index fd0e45f..c5f5ce9 100644 --- a/backend/static/js/app.js +++ b/backend/static/js/app.js @@ -3,7 +3,7 @@ Router, State-Management, Navigation, Initialisierung. ============================================================ */ -const APP_VER = '164'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VER = '166'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen const App = (() => { @@ -267,8 +267,10 @@ const App = (() => { return; } - // Sidebar-Logo → Willkommensseite - if (e.target.closest('.sidebar-logo-text')) { + // Sidebar-Logo → Willkommensseite (oder Hund-Profil wenn Hund aktiv) + // Hinweis: dog-sw-title hat eigenen Listener; dieser Fallback greift nur + // wenn kein Hund aktiv ist (statischer "Ban Yaro"-Text ohne dog-sw-title). + if (e.target.closest('.sidebar-logo-text') && !e.target.closest('.dog-sw-title')) { navigate('welcome'); _closeSidebar(); return; @@ -587,13 +589,17 @@ const App = (() => {
${avHtml(dog)}
- Ban Yaro + ${UI.escape(dog.name)} ${othersHtml}`; - // Klick aktiver Avatar → Hund-Profil + // Klick aktiver Avatar oder Name → Hund-Profil el.querySelector(`#dog-sw-active-${ctxId}`)?.addEventListener('click', () => { navigate('dog-profile'); }); + el.querySelector(`.dog-sw-title`)?.addEventListener('click', () => { + navigate('dog-profile'); + if (ctxId === 'sb') _closeSidebar(); + }); // 1 anderer Hund → direkter Tausch if (others.length === 1) { diff --git a/backend/static/sw.js b/backend/static/sw.js index 5261bdd..12369fd 100644 --- a/backend/static/sw.js +++ b/backend/static/sw.js @@ -3,7 +3,7 @@ Offline-Cache + Push Notifications + Tile-Cache ============================================================ */ -const CACHE_VERSION = 'by-v193'; +const CACHE_VERSION = 'by-v198'; const CACHE_STATIC = `${CACHE_VERSION}-static`; const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten