Browse Source

feat: call gatherSymbol after currency addition (#5421)

pull/5434/head
Sven Günther 4 months ago
parent
commit
26d697f092
  1. 14
      apps/client/src/app/components/admin-market-data/admin-market-data.component.ts
  2. 6
      apps/client/src/app/components/admin-market-data/create-asset-profile-dialog/create-asset-profile-dialog.component.ts

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

@ -63,7 +63,7 @@ import {
} from 'ionicons/icons';
import { DeviceDetectorService } from 'ngx-device-detector';
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
import { Subject } from 'rxjs';
import { Subject, of } from 'rxjs';
import { distinctUntilChanged, switchMap, takeUntil } from 'rxjs/operators';
import { AdminMarketDataService } from './admin-market-data.service';
@ -480,11 +480,21 @@ export class GfAdminMarketDataComponent
dialogRef
.afterClosed()
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe(({ dataSource, symbol } = {}) => {
.subscribe(({ dataSource, symbol, isCurrency } = {}) => {
if (dataSource && symbol) {
this.adminService
.addAssetProfile({ dataSource, symbol })
.pipe(
switchMap(() => {
// Call gatherSymbol for currencies to collect historical data
if (isCurrency) {
return this.adminService.gatherSymbol({
dataSource,
symbol
});
}
return of(null);
}),
switchMap(() => {
this.isLoading = true;
this.changeDetectorRef.markForCheck();

6
apps/client/src/app/components/admin-market-data/create-asset-profile-dialog/create-asset-profile-dialog.component.ts

@ -117,7 +117,11 @@ export class GfCreateAssetProfileDialogComponent implements OnInit, OnDestroy {
})
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe(() => {
this.dialogRef.close();
this.dialogRef.close({
dataSource: 'MANUAL',
symbol: `${currency}USD`,
isCurrency: true
});
});
} else if (this.mode === 'manual') {
this.dialogRef.close({

Loading…
Cancel
Save