Skip to content

Commit

Permalink
Update the notification using the selected event ID
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverguenther committed Sep 9, 2024
1 parent b9b2e08 commit cafee6b
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}

Expand Down Expand Up @@ -351,7 +351,7 @@ export class IanCenterService extends UntilDestroyedMixin {
return promise;
}

private updateSelectedNotification() {
private updateSelectedNotification(selected:string) {
void this
.notifications$
.pipe(
Expand All @@ -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;
Expand Down

0 comments on commit cafee6b

Please sign in to comment.