Browse Source

Refactoring

pull/6225/head
Thomas Kaul 1 week ago
parent
commit
6df731b1a6
  1. 28
      apps/client/src/app/components/admin-market-data/admin-market-data.component.ts

28
apps/client/src/app/components/admin-market-data/admin-market-data.component.ts

@ -416,26 +416,6 @@ export class GfAdminMarketDataComponent
}); });
} }
private refreshTable() {
this.isLoading = true;
this.changeDetectorRef.markForCheck();
this.adminService
.fetchAdminMarketData({
filters: this.activeFilters,
take: this.pageSize
})
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe(({ marketData }) => {
this.dataSource = new MatTableDataSource(marketData);
this.dataSource.sort = this.sort;
this.isLoading = false;
this.changeDetectorRef.markForCheck();
});
}
private openAssetProfileDialog({ private openAssetProfileDialog({
dataSource, dataSource,
symbol symbol
@ -504,6 +484,8 @@ export class GfAdminMarketDataComponent
.pipe(takeUntil(this.unsubscribeSubject)) .pipe(takeUntil(this.unsubscribeSubject))
.subscribe((result) => { .subscribe((result) => {
if (!result) { if (!result) {
this.router.navigate(['.'], { relativeTo: this.route });
return; return;
} }
@ -514,13 +496,13 @@ export class GfAdminMarketDataComponent
.addAssetProfile({ dataSource, symbol }) .addAssetProfile({ dataSource, symbol })
.pipe(takeUntil(this.unsubscribeSubject)) .pipe(takeUntil(this.unsubscribeSubject))
.subscribe(() => { .subscribe(() => {
this.refreshTable(); this.loadData();
}); });
} else { } else {
this.refreshTable(); this.loadData();
} }
this.router.navigate(['.'], { relativeTo: this.route }); this.onOpenAssetProfileDialog({ dataSource, symbol });
}); });
}); });
} }

Loading…
Cancel
Save