diff --git a/backend/main.py b/backend/main.py index 6dc2e56..b3a9124 100644 --- a/backend/main.py +++ b/backend/main.py @@ -406,7 +406,7 @@ async def serve_media(path: str, request: _Request): raise _HE(404, "Nicht gefunden.") return _media_response(filepath) -APP_VER = "935" # muss mit APP_VER in app.js übereinstimmen +APP_VER = "936" # muss mit APP_VER in app.js übereinstimmen @app.get("/.well-known/assetlinks.json") async def assetlinks(): diff --git a/backend/static/js/app.js b/backend/static/js/app.js index fff0a5e..ed72597 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 = '935'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VER = '936'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen const APP_VERSION = '1.5.1'; // ← semantische Version, wird bei make release gesetzt const IS_STAGING = location.hostname === 'staging.banyaro.app'; // Cache-Bust-Parameter nach Update-Reload sofort entfernen diff --git a/backend/static/js/worlds.js b/backend/static/js/worlds.js index 5884d71..b250a29 100644 --- a/backend/static/js/worlds.js +++ b/backend/static/js/worlds.js @@ -5,11 +5,12 @@ window.Worlds = (() => { - let _state = null; - let _cur = 1; // 0=JETZT 1=HUND 2=WELT - let _visible = false; - let _map = null; - let _weltInited = false; + let _state = null; + let _cur = 1; // 0=JETZT 1=HUND 2=WELT + let _visible = false; + let _map = null; + let _weltInited = false; + let _refreshPending = false; // gesetzt wenn refresh() während !_visible aufgerufen wird let _lastUserId = undefined; let _dogs = []; // gecachte Hundesliste let _dogIdx = 0; // aktuell angezeigter Hund @@ -118,6 +119,14 @@ window.Worlds = (() => { if (worldIdx != null) _goTo(worldIdx, false); if (_cur === 2 && !_weltInited) { _weltInited = true; _renderWelt(); } + // Ausstehender Refresh (z.B. nach Foto-Upload während Worlds unsichtbar) + if (_refreshPending) { + _refreshPending = false; + _renderJetzt(); + _renderHund(); + return; + } + // Nach Login/Logout: Config aus DB laden, dann rendern const currentUserId = _state?.user?.id ?? null; if (currentUserId !== _lastUserId) { @@ -1718,6 +1727,8 @@ window.Worlds = (() => { if (_cur === 0) _renderJetzt(); else if (_cur === 1) _renderHund(); else _renderWelt(); + } else { + _refreshPending = true; } } diff --git a/backend/static/sw.js b/backend/static/sw.js index 82082f6..4fa2787 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-v935'; +const CACHE_VERSION = 'by-v936'; 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