From 4e7ec1504ea7edd2a1a53f544f9964d4e32e4f86 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Wed, 27 Jan 2021 14:15:50 +0000 Subject: [PATCH] [Library | Trunk]: Roles users unsubscribe on role change git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@60304 d315682c-612b-4755-9ff5-7f18f6832af3 --- dashboard/users/role-users/role-users.component.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dashboard/users/role-users/role-users.component.ts b/dashboard/users/role-users/role-users.component.ts index a17a7a3b..4a1e275f 100644 --- a/dashboard/users/role-users/role-users.component.ts +++ b/dashboard/users/role-users/role-users.component.ts @@ -64,11 +64,16 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges { ngOnChanges(changes: SimpleChanges) { if(changes.role) { + this.unsubscribe(); this.updateLists(); } } ngOnDestroy() { + this.unsubscribe(); + } + + unsubscribe() { this.subs.forEach(sub => { if (sub instanceof Subscription) { sub.unsubscribe(); @@ -76,6 +81,7 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges { }); } + updateLists() { this.loadActive = true; this.loadPending = true;