diff --git a/dmp-frontend/src/app/ui/navbar/navbar.component.ts b/dmp-frontend/src/app/ui/navbar/navbar.component.ts index 32b996f30..46269c046 100644 --- a/dmp-frontend/src/app/ui/navbar/navbar.component.ts +++ b/dmp-frontend/src/app/ui/navbar/navbar.component.ts @@ -348,12 +348,13 @@ export class NavbarComponent extends BaseComponent implements OnInit { position: { top: '71px', right: '4.8em' }, width: "27.0rem" }); - this.inAppNotificationDialog.componentInstance.onReadAll.subscribe(() => { + const onReadAllSubscription = this.inAppNotificationDialog.componentInstance.onReadAll.subscribe(() => { this.countUnreadInappNotifications(); }); this.inAppNotificationDialog.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => { this.countUnreadInappNotifications(); this.inAppNotificationDialog = null; + onReadAllSubscription.unsubscribe(); }); } }