From 2854c60ba804235bb2601b9fb9bcc50b25a0dedd Mon Sep 17 00:00:00 2001 From: rene Date: Fri, 8 May 2026 10:56:36 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20Update-Button=20h=C3=A4ngt=20nicht=20meh?= =?UTF-8?q?r=20(kein=20await=20update()),=20Wrapped-Modal=20=C3=97=20hinte?= =?UTF-8?q?r=20Notch=20(safe-area)=20(SW=20by-v765)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/main.py | 2 +- backend/static/index.html | 2 +- backend/static/js/app.js | 9 ++++----- backend/static/js/pages/dog-profile.js | 4 ++-- backend/static/sw.js | 2 +- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/backend/main.py b/backend/main.py index 32cd7e6..9806d71 100644 --- a/backend/main.py +++ b/backend/main.py @@ -327,7 +327,7 @@ MEDIA_DIR = os.getenv("MEDIA_DIR", "/data/media") os.makedirs(MEDIA_DIR, exist_ok=True) app.mount("/media", StaticFiles(directory=MEDIA_DIR), name="media") -APP_VER = "764" # muss mit APP_VER in app.js übereinstimmen +APP_VER = "765" # muss mit APP_VER in app.js übereinstimmen @app.get("/api/version") async def app_version(): diff --git a/backend/static/index.html b/backend/static/index.html index cfe32d2..50b42f8 100644 --- a/backend/static/index.html +++ b/backend/static/index.html @@ -578,7 +578,7 @@ - + diff --git a/backend/static/js/app.js b/backend/static/js/app.js index 5666b13..50f2399 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 = '764'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VER = '765'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen const APP_VERSION = '1.5.0'; // ← semantische Version, wird bei make release gesetzt const IS_STAGING = location.hostname === 'staging.banyaro.app'; @@ -1037,16 +1037,15 @@ const App = (() => { btn.textContent = 'Lädt…'; btn.disabled = true; sessionStorage.setItem('by_update_reload', APP_VER); + // Reload immer nach 800ms — NICHT auf SW-Operationen warten (können auf iOS hängen) + setTimeout(() => location.replace(location.href), 800); try { - // SW aktivieren + alle Caches leeren für sauberen Reload const reg = await navigator.serviceWorker?.getRegistration(); if (reg?.waiting) reg.waiting.postMessage({ type: 'SKIP_WAITING' }); - await reg?.update(); + reg?.update().catch(() => {}); // kein await — kann hängen const keys = await caches.keys(); await Promise.all(keys.map(k => caches.delete(k))); } catch { /* ignorieren */ } - // location.replace bypassed iOS bfcache (reload() stellt alte Seite wieder her) - setTimeout(() => location.replace(location.href), 600); }); } diff --git a/backend/static/js/pages/dog-profile.js b/backend/static/js/pages/dog-profile.js index 58d5aa7..bdbf999 100644 --- a/backend/static/js/pages/dog-profile.js +++ b/backend/static/js/pages/dog-profile.js @@ -2073,8 +2073,8 @@ window.Page_dog_profile = (() => { const modalEl = document.createElement('div'); modalEl.style.cssText = 'position:fixed;inset:0;z-index:9999;background:#0d0d1a;display:flex;flex-direction:column;overflow:hidden;'; modalEl.innerHTML = ` -
- +
+
${cards[0]}
diff --git a/backend/static/sw.js b/backend/static/sw.js index 74e9882..d5b713f 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-v764'; +const CACHE_VERSION = 'by-v765'; const CACHE_STATIC = `${CACHE_VERSION}-static`; const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten const CACHE_API = 'ban-yaro-api-v1'; // API-Response-Cache