From a64fbde7997d433707befa10027b9c85e54fcd1c Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Fri, 5 Jun 2020 02:53:58 +0300 Subject: [PATCH] fix: memory leak problem --- .../identity/src/lib/components/roles/roles.component.ts | 8 ++++---- .../identity/src/lib/components/users/users.component.ts | 8 ++++---- .../src/lib/components/tenants/tenants.component.ts | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.ts b/npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.ts index 09582f4e9f..73a9a64dfb 100644 --- a/npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.ts +++ b/npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.ts @@ -57,7 +57,7 @@ export class RolesComponent implements OnInit { ) {} ngOnInit() { - this.get(); + this.hookToQuery(); } buildForm() { @@ -104,7 +104,7 @@ export class RolesComponent implements OnInit { .pipe(finalize(() => (this.modalBusy = false))) .subscribe(() => { this.isModalVisible = false; - this.get(); + this.list.get(); }); } @@ -115,12 +115,12 @@ export class RolesComponent implements OnInit { }) .subscribe((status: Confirmation.Status) => { if (status === Confirmation.Status.confirm) { - this.store.dispatch(new DeleteRole(id)).subscribe(() => this.get()); + this.store.dispatch(new DeleteRole(id)).subscribe(() => this.list.get()); } }); } - get() { + private hookToQuery() { this.list.hookToQuery(query => this.store.dispatch(new GetRoles(query))).subscribe(); } diff --git a/npm/ng-packs/packages/identity/src/lib/components/users/users.component.ts b/npm/ng-packs/packages/identity/src/lib/components/users/users.component.ts index 33aa8ee40d..5a55c8f51f 100644 --- a/npm/ng-packs/packages/identity/src/lib/components/users/users.component.ts +++ b/npm/ng-packs/packages/identity/src/lib/components/users/users.component.ts @@ -77,7 +77,7 @@ export class UsersComponent implements OnInit { ) {} ngOnInit() { - this.get(); + this.hookToQuery(); } buildForm() { @@ -172,7 +172,7 @@ export class UsersComponent implements OnInit { .pipe(finalize(() => (this.modalBusy = false))) .subscribe(() => { this.isModalVisible = false; - this.get(); + this.list.get(); }); } @@ -183,7 +183,7 @@ export class UsersComponent implements OnInit { }) .subscribe((status: Confirmation.Status) => { if (status === Confirmation.Status.confirm) { - this.store.dispatch(new DeleteUser(id)).subscribe(() => this.get()); + this.store.dispatch(new DeleteUser(id)).subscribe(() => this.list.get()); } }); } @@ -194,7 +194,7 @@ export class UsersComponent implements OnInit { this.list.sortOrder = dir; } - get() { + private hookToQuery() { this.list.hookToQuery(query => this.store.dispatch(new GetUsers(query))).subscribe(); } diff --git a/npm/ng-packs/packages/tenant-management/src/lib/components/tenants/tenants.component.ts b/npm/ng-packs/packages/tenant-management/src/lib/components/tenants/tenants.component.ts index 7eb40e53e8..c0a431bbb5 100644 --- a/npm/ng-packs/packages/tenant-management/src/lib/components/tenants/tenants.component.ts +++ b/npm/ng-packs/packages/tenant-management/src/lib/components/tenants/tenants.component.ts @@ -107,7 +107,7 @@ export class TenantsComponent implements OnInit { ) {} ngOnInit() { - this.get(); + this.hookToQuery(); } private createTenantForm() { @@ -231,7 +231,7 @@ export class TenantsComponent implements OnInit { .pipe(finalize(() => (this.modalBusy = false))) .subscribe(() => { this.isModalVisible = false; - this.get(); + this.list.get(); }); } @@ -246,12 +246,12 @@ export class TenantsComponent implements OnInit { ) .subscribe((status: Confirmation.Status) => { if (status === Confirmation.Status.confirm) { - this.store.dispatch(new DeleteTenant(id)).subscribe(() => this.get()); + this.store.dispatch(new DeleteTenant(id)).subscribe(() => this.list.get()); } }); } - get() { + hookToQuery() { this.list.hookToQuery(query => this.store.dispatch(new GetTenants(query))).subscribe(); }