diff --git a/backend/main.py b/backend/main.py index 164ff54..4bcd9ba 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 = "917" # muss mit APP_VER in app.js übereinstimmen +APP_VER = "918" # muss mit APP_VER in app.js übereinstimmen @app.get("/.well-known/assetlinks.json") async def assetlinks(): diff --git a/backend/static/index.html b/backend/static/index.html index d411c33..0e13659 100644 --- a/backend/static/index.html +++ b/backend/static/index.html @@ -599,10 +599,10 @@ - - - - + + + + diff --git a/backend/static/js/app.js b/backend/static/js/app.js index fc9d1de..c6d2189 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 = '917'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VER = '918'; // ← 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 c95416c..0c3c15d 100644 --- a/backend/static/js/worlds.js +++ b/backend/static/js/worlds.js @@ -569,24 +569,38 @@ window.Worlds = (() => { // _cfgCache: wird beim Init aus DB geladen, Fallback localStorage → Default let _cfgCache = null; + function _mergeDefaults(cfg) { + // Neue Default-Chips die noch nicht in der gespeicherten Config sind → anhängen + const result = JSON.parse(JSON.stringify(cfg)); + for (const world of ['jetzt', 'hund', 'welt']) { + const def = _DEFAULT_CONFIG[world] || []; + const saved = result[world] || []; + for (const page of def) { + if (!saved.includes(page)) saved.push(page); + } + result[world] = saved; + } + return result; + } + async function _loadConfigFromServer() { try { const res = await API.get('/profile/world-config'); if (res?.config) { - _cfgCache = res.config; + _cfgCache = _mergeDefaults(res.config); try { localStorage.setItem('world_chips', JSON.stringify(_cfgCache)); } catch {} return; } // Noch nichts in DB: lokale Config hochladen (einmalige Migration) const local = (() => { try { return JSON.parse(localStorage.getItem('world_chips') || 'null'); } catch { return null; } })(); if (local) { - _cfgCache = local; - API.put('/profile/world-config', { config: local }).catch(() => {}); + _cfgCache = _mergeDefaults(local); + API.put('/profile/world-config', { config: _cfgCache }).catch(() => {}); return; } } catch {} // Fallback: localStorage → Default - try { _cfgCache = JSON.parse(localStorage.getItem('world_chips') || 'null') || _DEFAULT_CONFIG; } + try { _cfgCache = _mergeDefaults(JSON.parse(localStorage.getItem('world_chips') || 'null') || _DEFAULT_CONFIG); } catch { _cfgCache = _DEFAULT_CONFIG; } } diff --git a/backend/static/sw.js b/backend/static/sw.js index 91b4097..e5fe3f5 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-v917'; +const CACHE_VERSION = 'by-v918'; 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