Fix: Notifications-Klick-Handler durch UI.toast-TypeError blockiert

UI.toast ist ein Objekt {success,error,info}, kein Funktion.
UI.toast?.('...','info') wirft TypeError → async handler crasht still
→ setTimeout(_execNav) wird nie ausgeführt → keine Navigation

Fix: UI.toast?.info?.(…) / UI.toast?.error?.(…)
This commit is contained in:
rene 2026-04-19 10:16:46 +02:00
parent bb0250a8b5
commit 90f1c4e299
3 changed files with 5 additions and 5 deletions

View file

@ -3,7 +3,7 @@
Router, State-Management, Navigation, Initialisierung. Router, State-Management, Navigation, Initialisierung.
============================================================ */ ============================================================ */
const APP_VER = '210'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen const APP_VER = '211'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
const App = (() => { const App = (() => {

View file

@ -183,7 +183,7 @@ window.Page_notifications = (() => {
items = items.map(n => ({ ...n, read_at: new Date().toISOString() })); items = items.map(n => ({ ...n, read_at: new Date().toISOString() }));
_render(items); _render(items);
} catch (e) { } catch (e) {
UI.toast?.('Fehler beim Markieren.', 'error'); UI.toast?.error?.('Fehler beim Markieren.');
} }
}); });
} }
@ -223,7 +223,7 @@ window.Page_notifications = (() => {
API.notifications.read(id).catch(() => {}); API.notifications.read(id).catch(() => {});
if (nav.page) { if (nav.page) {
if (nav.label) UI.toast?.(`Öffne ${nav.label}`, 'info'); if (nav.label) UI.toast?.info?.(`Öffne ${nav.label}`);
setTimeout(() => _execNav(nav), 150); setTimeout(() => _execNav(nav), 150);
} else { } else {
setTimeout(() => { el.style.opacity = ''; }, 800); setTimeout(() => { el.style.opacity = ''; }, 800);
@ -261,7 +261,7 @@ window.Page_notifications = (() => {
item.style.opacity = ''; item.style.opacity = '';
item.style.transform = ''; item.style.transform = '';
} }
UI.toast?.('Löschen fehlgeschlagen.', 'error'); UI.toast?.error?.('Löschen fehlgeschlagen.');
} }
}); });
}); });

View file

@ -3,7 +3,7 @@
Offline-Cache + Push Notifications + Tile-Cache Offline-Cache + Push Notifications + Tile-Cache
============================================================ */ ============================================================ */
const CACHE_VERSION = 'by-v233'; const CACHE_VERSION = 'by-v234';
const CACHE_STATIC = `${CACHE_VERSION}-static`; const CACHE_STATIC = `${CACHE_VERSION}-static`;
const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten