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

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