Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Show above notification when the last notification is marked as read

Henriette Dargeff3b476ad056
diff --git a/frontend/src/app/features/in-app-notifications/center/state/ian-center.service.ts b/frontend/src/app/features/in-app-notifications/center/state/ian-center.service.ts
index c5d1eab7130..24a31d87524 100644
--- a/frontend/src/app/features/in-app-notifications/center/state/ian-center.service.ts
+++ b/frontend/src/app/features/in-app-notifications/center/state/ian-center.service.ts
@@ -255,7 +255,15 @@ export class IanCenterService extends UntilDestroyedMixin {
return;
}
if (notifications[0][0]._links.resource || notifications[this.selectedNotificationIndex][0]._links.resource) {
- const wpId = idFromLink(notifications[this.selectedNotificationIndex >= notifications.length ? 0 : this.selectedNotificationIndex][0]._links.resource.href);
+ let index:number;
+ if (this.selectedNotificationIndex === notifications.length) {
+ // If the last notification is marked as read, we do not jump to the top, but rather show the new last notification
+ index = notifications.length - 1;
+ } else {
+ index = this.selectedNotificationIndex > notifications.length ? 0 : this.selectedNotificationIndex;
+ }
+
+ const wpId = idFromLink(notifications[index][0]._links.resource.href);
this.openSplitScreen(wpId);
}
});