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({
dataSource,
symbol
@ -504,6 +484,8 @@ export class GfAdminMarketDataComponent
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe((result) => {
if (!result) {
this.router.navigate(['.'], { relativeTo: this.route });
return;
}
@ -514,13 +496,13 @@ export class GfAdminMarketDataComponent
.addAssetProfile({ dataSource, symbol })
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe(() => {
this.refreshTable();
this.loadData();
});
} else {
this.refreshTable();
this.loadData();
}
this.router.navigate(['.'], { relativeTo: this.route });
this.onOpenAssetProfileDialog({ dataSource, symbol });
});
});
}

Loading…
Cancel
Save