diff --git a/backend/main.py b/backend/main.py index 4c973dc..6a1aec1 100644 --- a/backend/main.py +++ b/backend/main.py @@ -410,7 +410,7 @@ async def serve_media(path: str, request: _Request): raise _HE(404, "Nicht gefunden.") return _media_response(filepath) -APP_VER = "1000" # muss mit APP_VER in app.js übereinstimmen +APP_VER = "1001" # 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 d7eaab5..15d5876 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 = '1000'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VER = '1001'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen const APP_VERSION = '1.6.0'; // ← 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 35cb433..aad758e 100644 --- a/backend/static/js/worlds.js +++ b/backend/static/js/worlds.js @@ -598,13 +598,21 @@ window.Worlds = (() => { 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)); + const result = JSON.parse(JSON.stringify(cfg)); + const hidden = new Set(result.hidden || []); + // Chips die bereits einer Welt zugewiesen sind, nicht nochmal einfügen + const allAssigned = new Set([ + ...(result.jetzt || []), ...(result.hund || []), ...(result.welt || []), + ]); 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); + // Nur echte Neu-Chips anhängen: nicht zugewiesen UND nicht bewusst ausgeblendet + if (!allAssigned.has(page) && !hidden.has(page)) { + saved.push(page); + allAssigned.add(page); + } } result[world] = saved; } @@ -637,6 +645,11 @@ window.Worlds = (() => { } function _saveConfig(cfg) { + // Bewusst ausgeblendete Chips tracken: Default-Chips die keiner Welt zugewiesen sind + const allAssigned = new Set([...(cfg.jetzt||[]), ...(cfg.hund||[]), ...(cfg.welt||[])]); + const allDefault = [..._DEFAULT_CONFIG.jetzt, ..._DEFAULT_CONFIG.hund, ..._DEFAULT_CONFIG.welt]; + cfg.hidden = allDefault.filter(p => !allAssigned.has(p)); + _cfgCache = cfg; try { localStorage.setItem('world_chips', JSON.stringify(cfg)); } catch {} if (_state?.user) { diff --git a/backend/static/sw.js b/backend/static/sw.js index 84e2787..9c8a92f 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-v1000'; +const CACHE_VERSION = 'by-v1001'; 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