Merge pull request #5171 from mempool/nymkappa/fix-accel-dashboard-many-pending

[accelerator] always show last 6 completed accelerations in accel dashboard
This commit is contained in:
softsimon 2024-06-20 02:16:28 +09:00 committed by GitHub
commit 02eb633d89
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -96,10 +96,16 @@ export class AcceleratorDashboardComponent implements OnInit, OnDestroy {
share(),
);
this.minedAccelerations$ = this.accelerations$.pipe(
map(accelerations => {
return accelerations.filter(acc => ['completed_provisional', 'completed'].includes(acc.status));
})
this.minedAccelerations$ = this.stateService.chainTip$.pipe(
distinctUntilChanged(),
switchMap(() => {
return this.serviceApiServices.getAccelerationHistory$({ status: 'completed', pageLength: 6 }).pipe(
catchError(() => {
return of([]);
}),
);
}),
share(),
);
this.blocks$ = combineLatest([