From 68c38a2a0ae4097265b060d0f01a046d23e30735 Mon Sep 17 00:00:00 2001 From: rene Date: Fri, 8 May 2026 11:13:41 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20Update-Reload=20navigiert=20zu=20'/'=20s?= =?UTF-8?q?tatt=20location.href=20=E2=80=94=20verhindert=20Tagebuch-Endlos?= =?UTF-8?q?lade=20(SW=20by-v767)?= 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 | 6 +++--- backend/static/sw.js | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/backend/main.py b/backend/main.py index de9c1e6..974b3f9 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 = "766" # muss mit APP_VER in app.js übereinstimmen +APP_VER = "767" # 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 830d2ca..fbe19b2 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 9d78fe4..788927f 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 = '766'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VER = '767'; // ← 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,8 +1037,8 @@ 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); + // Immer zur Root — location.href enthält ggf. Hash der App in alten Zustand navigiert + setTimeout(() => location.replace('/'), 800); try { const reg = await navigator.serviceWorker?.getRegistration(); if (reg?.waiting) reg.waiting.postMessage({ type: 'SKIP_WAITING' }); diff --git a/backend/static/sw.js b/backend/static/sw.js index 4cf6e43..c3e4362 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-v766'; +const CACHE_VERSION = 'by-v767'; 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