From a6b04e9ce59b153fe8e268dea34ebcdcc3e05834 Mon Sep 17 00:00:00 2001 From: Sofia Papacharalampous Date: Mon, 20 May 2024 11:40:06 +0300 Subject: [PATCH] unsubscribre from "read all" event --- dmp-frontend/src/app/ui/navbar/navbar.component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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(); }); } }