diff --git a/backend/static/js/app.js b/backend/static/js/app.js index 86b0391..d81df0e 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 = '209'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VER = '210'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen const App = (() => { diff --git a/backend/static/js/pages/notifications.js b/backend/static/js/pages/notifications.js index 6737824..c956a85 100644 --- a/backend/static/js/pages/notifications.js +++ b/backend/static/js/pages/notifications.js @@ -33,11 +33,18 @@ window.Page_notifications = (() => { } } - /** Parst n.data sicher — egal ob String oder Objekt */ + /** Parst n.data sicher und flacht verschachteltes {data:{…}} auf */ function _parseData(raw) { if (!raw) return {}; - if (typeof raw === 'object') return raw; - try { return JSON.parse(raw); } catch (_) { return {}; } + let obj = (typeof raw === 'object') ? raw : (() => { + try { return JSON.parse(raw); } catch (_) { return {}; } + })(); + // push.py speichert payload-Felder direkt: {data: {conversation_id:…}, tag:…} + // Das innere 'data' nach oben holen damit d.conversation_id etc. direkt verfügbar sind + if (obj.data && typeof obj.data === 'object') { + obj = { ...obj, ...obj.data }; + } + return obj; } /** @@ -108,18 +115,19 @@ window.Page_notifications = (() => { data: _parseData(n.data) }); return ` -
+ -
`; + + `; } /** Führt die kontextspezifische Navigation aus */ @@ -228,7 +236,7 @@ window.Page_notifications = (() => { btn.addEventListener('click', async (e) => { e.stopPropagation(); const id = parseInt(btn.dataset.del, 10); - const item = btn.closest('.notif-item'); + const item = btn.closest('button.notif-item') || btn.closest('.notif-item'); // Sofortiges visuelles Feedback if (item) { diff --git a/backend/static/sw.js b/backend/static/sw.js index f5013e8..2900d55 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-v232'; +const CACHE_VERSION = 'by-v233'; const CACHE_STATIC = `${CACHE_VERSION}-static`; const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten