Fix: Benachrichtigungen öffnen direkt das Ziel-Item

- forum_reply → öffnet direkt den Forum-Thread (openThread exposed)
- walk_invite → öffnet direkt das Gassi-Treffen (openDetail exposed)
- poison_alert → öffnet direkt den Giftköder-Eintrag (openDetail exposed)
- chat_message → öffnet direkt den Chat-Thread (war schon vorhanden)
- _execNav nutzt nav.data statt nav.data?.field für konsistentes Parsing
This commit is contained in:
rene 2026-04-19 10:22:13 +02:00
parent 05b28fcd8d
commit eef787cc72
6 changed files with 45 additions and 17 deletions

View file

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

View file

@ -1009,6 +1009,6 @@ window.Page_forum = (() => {
document.body.appendChild(lb); document.body.appendChild(lb);
} }
return { init, refresh, onDogChange, openNew }; return { init, refresh, onDogChange, openNew, openThread: _openThread };
})(); })();

View file

@ -63,22 +63,35 @@ window.Page_notifications = (() => {
: () => App.navigate('chat'), : () => App.navigate('chat'),
}; };
case 'friend_request': case 'forum_reply':
case 'forum_mention':
return { return {
page: 'friends', label: 'Freunde', page: 'forum', label: 'Forum',
go: () => App.navigate('friends'), go: d.id
? () => App.callModule('forum', 'openThread', d.id)
: () => App.navigate('forum'),
}; };
case 'walk_invite': case 'walk_invite':
return { return {
page: 'walks', label: 'Gassi-Treffen', page: 'walks', label: 'Gassi-Treffen',
go: () => App.navigate('walks'), go: d.walk_id
? () => App.callModule('walks', 'openDetail', d.walk_id)
: () => App.navigate('walks'),
}; };
case 'poison_alert': case 'poison_alert':
return { return {
page: 'poison', label: 'Giftköder-Alarm', page: 'poison', label: 'Giftköder-Alarm',
go: () => App.navigate('poison'), go: d.id
? () => App.callModule('poison', 'openDetail', { id: d.id })
: () => App.navigate('poison'),
};
case 'friend_request':
return {
page: 'friends', label: 'Freunde',
go: () => App.navigate('friends'),
}; };
case 'health_reminder': case 'health_reminder':
@ -132,17 +145,32 @@ window.Page_notifications = (() => {
/** Führt die kontextspezifische Navigation aus */ /** Führt die kontextspezifische Navigation aus */
function _execNav(nav) { function _execNav(nav) {
const d = nav.data || {};
switch (nav.type) { switch (nav.type) {
case 'chat_message': case 'chat_message':
nav.data?.conversation_id d.conversation_id
? App.callModule('chat', '_openThread', nav.data.conversation_id) ? App.callModule('chat', '_openThread', d.conversation_id)
: App.navigate('chat'); : App.navigate('chat');
break; break;
case 'friend_request': App.navigate('friends'); break; case 'forum_reply':
case 'walk_invite': App.navigate('walks'); break; case 'forum_mention':
case 'poison_alert': App.navigate('poison'); break; d.id
case 'health_reminder':App.navigate('health'); break; ? App.callModule('forum', 'openThread', d.id)
case 'milestone': App.navigate('diary'); break; : App.navigate('forum');
break;
case 'walk_invite':
d.walk_id
? App.callModule('walks', 'openDetail', d.walk_id)
: App.navigate('walks');
break;
case 'poison_alert':
d.id
? App.callModule('poison', 'openDetail', { id: d.id })
: App.navigate('poison');
break;
case 'friend_request': App.navigate('friends'); break;
case 'health_reminder':App.navigate('health'); break;
case 'milestone': App.navigate('diary'); break;
default: default:
if (nav.page) App.navigate(nav.page); if (nav.page) App.navigate(nav.page);
} }

View file

@ -585,6 +585,6 @@ window.Page_poison = (() => {
// ---------------------------------------------------------- // ----------------------------------------------------------
// PUBLIC // PUBLIC
// ---------------------------------------------------------- // ----------------------------------------------------------
return { init, refresh, openNew }; return { init, refresh, openNew, openDetail: _openDetail };
})(); })();

View file

@ -952,6 +952,6 @@ window.Page_walks = (() => {
}); });
} }
return { init, refresh, onDogChange, openNew }; return { init, refresh, onDogChange, openNew, openDetail: _openDetail };
})(); })();

View file

@ -3,7 +3,7 @@
Offline-Cache + Push Notifications + Tile-Cache Offline-Cache + Push Notifications + Tile-Cache
============================================================ */ ============================================================ */
const CACHE_VERSION = 'by-v235'; const CACHE_VERSION = 'by-v236';
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