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

Update the notification using the selected event ID

Oliver Günthercafee6be0434
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 9e9de51e4dc..4c215a07cbc 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
@@ -196,8 +196,8 @@ export class IanCenterService extends UntilDestroyedMixin {
super();
this.reload.subscribe();
- this.selectedWorkPackage$.subscribe(() => {
- this.updateSelectedNotification();
+ this.selectedWorkPackage$.subscribe((id:string) => {
+ this.updateSelectedNotification(id);
});
}
@@ -351,7 +351,7 @@ export class IanCenterService extends UntilDestroyedMixin {
return promise;
}
- private updateSelectedNotification() {
+ private updateSelectedNotification(selected:string) {
void this
.notifications$
.pipe(
@@ -360,8 +360,7 @@ export class IanCenterService extends UntilDestroyedMixin {
.subscribe(
(notifications:INotification[][]) => {
for (let i = 0; i < notifications.length; ++i) {
- if (notifications[i][0]._links.resource
- && idFromLink(notifications[i][0]._links.resource.href) === this.urlParams.pathMatching(/\/details\/(\d+)/)) {
+ if (notifications[i][0]._links.resource && idFromLink(notifications[i][0]._links.resource.href) === selected) {
this.selectedNotificationIndex = i;
[this.selectedNotification] = notifications[i];
return;