|
|
|
@ -63,7 +63,7 @@ import { |
|
|
|
import { DeviceDetectorService } from 'ngx-device-detector'; |
|
|
|
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; |
|
|
|
import { Subject } from 'rxjs'; |
|
|
|
import { distinctUntilChanged, switchMap, takeUntil } from 'rxjs/operators'; |
|
|
|
import { distinctUntilChanged, takeUntil } from 'rxjs/operators'; |
|
|
|
|
|
|
|
import { AdminMarketDataService } from './admin-market-data.service'; |
|
|
|
import { GfAssetProfileDialogComponent } from './asset-profile-dialog/asset-profile-dialog.component'; |
|
|
|
@ -482,32 +482,27 @@ export class GfAdminMarketDataComponent |
|
|
|
dialogRef |
|
|
|
.afterClosed() |
|
|
|
.pipe(takeUntil(this.unsubscribeSubject)) |
|
|
|
.subscribe(({ dataSource, symbol } = {}) => { |
|
|
|
if (dataSource && symbol) { |
|
|
|
.subscribe((result) => { |
|
|
|
if (!result) { |
|
|
|
this.router.navigate(['.'], { relativeTo: this.route }); |
|
|
|
|
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
const { addAssetProfile, dataSource, symbol } = result; |
|
|
|
|
|
|
|
if (addAssetProfile && dataSource && symbol) { |
|
|
|
this.adminService |
|
|
|
.addAssetProfile({ dataSource, symbol }) |
|
|
|
.pipe( |
|
|
|
switchMap(() => { |
|
|
|
this.isLoading = true; |
|
|
|
this.changeDetectorRef.markForCheck(); |
|
|
|
|
|
|
|
return this.adminService.fetchAdminMarketData({ |
|
|
|
filters: this.activeFilters, |
|
|
|
take: this.pageSize |
|
|
|
}); |
|
|
|
}), |
|
|
|
takeUntil(this.unsubscribeSubject) |
|
|
|
) |
|
|
|
.subscribe(({ marketData }) => { |
|
|
|
this.dataSource = new MatTableDataSource(marketData); |
|
|
|
this.dataSource.sort = this.sort; |
|
|
|
this.isLoading = false; |
|
|
|
|
|
|
|
this.changeDetectorRef.markForCheck(); |
|
|
|
.pipe(takeUntil(this.unsubscribeSubject)) |
|
|
|
.subscribe(() => { |
|
|
|
this.loadData(); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
this.loadData(); |
|
|
|
} |
|
|
|
|
|
|
|
this.router.navigate(['.'], { relativeTo: this.route }); |
|
|
|
this.onOpenAssetProfileDialog({ dataSource, symbol }); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
|