Browse Source

fix: memory leak problem

pull/4216/head
mehmet-erim 6 years ago
parent
commit
a64fbde799
  1. 8
      npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.ts
  2. 8
      npm/ng-packs/packages/identity/src/lib/components/users/users.component.ts
  3. 8
      npm/ng-packs/packages/tenant-management/src/lib/components/tenants/tenants.component.ts

8
npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.ts

@ -57,7 +57,7 @@ export class RolesComponent implements OnInit {
) {} ) {}
ngOnInit() { ngOnInit() {
this.get(); this.hookToQuery();
} }
buildForm() { buildForm() {
@ -104,7 +104,7 @@ export class RolesComponent implements OnInit {
.pipe(finalize(() => (this.modalBusy = false))) .pipe(finalize(() => (this.modalBusy = false)))
.subscribe(() => { .subscribe(() => {
this.isModalVisible = false; this.isModalVisible = false;
this.get(); this.list.get();
}); });
} }
@ -115,12 +115,12 @@ export class RolesComponent implements OnInit {
}) })
.subscribe((status: Confirmation.Status) => { .subscribe((status: Confirmation.Status) => {
if (status === Confirmation.Status.confirm) { 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(); this.list.hookToQuery(query => this.store.dispatch(new GetRoles(query))).subscribe();
} }

8
npm/ng-packs/packages/identity/src/lib/components/users/users.component.ts

@ -77,7 +77,7 @@ export class UsersComponent implements OnInit {
) {} ) {}
ngOnInit() { ngOnInit() {
this.get(); this.hookToQuery();
} }
buildForm() { buildForm() {
@ -172,7 +172,7 @@ export class UsersComponent implements OnInit {
.pipe(finalize(() => (this.modalBusy = false))) .pipe(finalize(() => (this.modalBusy = false)))
.subscribe(() => { .subscribe(() => {
this.isModalVisible = false; this.isModalVisible = false;
this.get(); this.list.get();
}); });
} }
@ -183,7 +183,7 @@ export class UsersComponent implements OnInit {
}) })
.subscribe((status: Confirmation.Status) => { .subscribe((status: Confirmation.Status) => {
if (status === Confirmation.Status.confirm) { 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; this.list.sortOrder = dir;
} }
get() { private hookToQuery() {
this.list.hookToQuery(query => this.store.dispatch(new GetUsers(query))).subscribe(); this.list.hookToQuery(query => this.store.dispatch(new GetUsers(query))).subscribe();
} }

8
npm/ng-packs/packages/tenant-management/src/lib/components/tenants/tenants.component.ts

@ -107,7 +107,7 @@ export class TenantsComponent implements OnInit {
) {} ) {}
ngOnInit() { ngOnInit() {
this.get(); this.hookToQuery();
} }
private createTenantForm() { private createTenantForm() {
@ -231,7 +231,7 @@ export class TenantsComponent implements OnInit {
.pipe(finalize(() => (this.modalBusy = false))) .pipe(finalize(() => (this.modalBusy = false)))
.subscribe(() => { .subscribe(() => {
this.isModalVisible = false; this.isModalVisible = false;
this.get(); this.list.get();
}); });
} }
@ -246,12 +246,12 @@ export class TenantsComponent implements OnInit {
) )
.subscribe((status: Confirmation.Status) => { .subscribe((status: Confirmation.Status) => {
if (status === Confirmation.Status.confirm) { 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(); this.list.hookToQuery(query => this.store.dispatch(new GetTenants(query))).subscribe();
} }

Loading…
Cancel
Save