Fix: Welten refresh nach Foto-Upload — _refreshPending Flag (SW by-v936)
show() re-renderte nur bei User-Wechsel. Wenn refresh() während unsichtbarer Welten aufgerufen wurde, blieb das alte Bild beim Zurücknavigieren. Fix: _refreshPending=true wenn !_visible; show() rendert bei nächstem Aufruf neu.
This commit is contained in:
parent
fbb070032a
commit
2b672c89df
4 changed files with 19 additions and 8 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue