[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
This commit is contained in:
k.triantafyllou 2021-01-27 14:15:50 +00:00
parent a31eddcc2c
commit 4e7ec1504e
1 changed files with 6 additions and 0 deletions

View File

@ -64,11 +64,16 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
ngOnChanges(changes: SimpleChanges) { ngOnChanges(changes: SimpleChanges) {
if(changes.role) { if(changes.role) {
this.unsubscribe();
this.updateLists(); this.updateLists();
} }
} }
ngOnDestroy() { ngOnDestroy() {
this.unsubscribe();
}
unsubscribe() {
this.subs.forEach(sub => { this.subs.forEach(sub => {
if (sub instanceof Subscription) { if (sub instanceof Subscription) {
sub.unsubscribe(); sub.unsubscribe();
@ -76,6 +81,7 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
}); });
} }
updateLists() { updateLists() {
this.loadActive = true; this.loadActive = true;
this.loadPending = true; this.loadPending = true;