From f26b630aabd062ec426df16635190db8624753b0 Mon Sep 17 00:00:00 2001 From: Mononaut Date: Wed, 30 Aug 2023 22:24:27 +0900 Subject: [PATCH] Fix acceleration dashboard merge issues --- .../acceleration-fees-graph.component.ts | 10 +++++----- .../accelerations-list.component.html | 1 + .../accelerations-list/accelerations-list.component.ts | 6 +++--- .../accelerator-dashboard.component.ts | 4 ++-- frontend/src/app/graphs/graphs.routing.module.ts | 6 ++++++ 5 files changed, 17 insertions(+), 10 deletions(-) diff --git a/frontend/src/app/components/acceleration-fees-graph/acceleration-fees-graph.component.ts b/frontend/src/app/components/acceleration-fees-graph/acceleration-fees-graph.component.ts index f666c8f31..bba0cbc3e 100644 --- a/frontend/src/app/components/acceleration-fees-graph/acceleration-fees-graph.component.ts +++ b/frontend/src/app/components/acceleration-fees-graph/acceleration-fees-graph.component.ts @@ -98,7 +98,7 @@ export class AccelerationFeesGraphComponent implements OnInit { this.isLoading = true; this.storageService.setValue('miningWindowPreference', timespan); this.timespan = timespan; - return this.apiService.getAccelerations$(); + return this.apiService.getAccelerationHistory$(); }) ), this.radioGroupForm.get('dateSpan').valueChanges.pipe( @@ -128,11 +128,11 @@ export class AccelerationFeesGraphComponent implements OnInit { const blockAccelerations = {}; for (const acceleration of accelerations) { - if (acceleration.mined) { - if (!blockAccelerations[acceleration.block_height]) { - blockAccelerations[acceleration.block_height] = []; + if (acceleration.status === 'mined' || acceleration.status === 'completed') { + if (!blockAccelerations[acceleration.blockHeight]) { + blockAccelerations[acceleration.blockHeight] = []; } - blockAccelerations[acceleration.block_height].push(acceleration); + blockAccelerations[acceleration.blockHeight].push(acceleration); } } diff --git a/frontend/src/app/components/accelerations-list/accelerations-list.component.html b/frontend/src/app/components/accelerations-list/accelerations-list.component.html index 4b37f28c0..80f1c1dbf 100644 --- a/frontend/src/app/components/accelerations-list/accelerations-list.component.html +++ b/frontend/src/app/components/accelerations-list/accelerations-list.component.html @@ -28,6 +28,7 @@ {{ acceleration.feeDelta | number }} sat + Pending Mined Canceled diff --git a/frontend/src/app/components/accelerations-list/accelerations-list.component.ts b/frontend/src/app/components/accelerations-list/accelerations-list.component.ts index 70dbd03f0..efc900bd5 100644 --- a/frontend/src/app/components/accelerations-list/accelerations-list.component.ts +++ b/frontend/src/app/components/accelerations-list/accelerations-list.component.ts @@ -39,12 +39,12 @@ export class AccelerationsListComponent implements OnInit { this.skeletonLines = this.widget === true ? [...Array(6).keys()] : [...Array(15).keys()]; this.paginationMaxSize = window.matchMedia('(max-width: 670px)').matches ? 3 : 5; - this.accelerations$ = this.apiService.getAccelerations$().pipe( + this.accelerations$ = this.apiService.getAccelerationHistory$().pipe( switchMap(accelerations => { if (this.widget) { - return of(accelerations.slice(0, 6)); + return of(accelerations.slice(-6).reverse()); } else { - return of(accelerations); + return of(accelerations.reverse()); } }), catchError((err) => { diff --git a/frontend/src/app/components/accelerator-dashboard/accelerator-dashboard.component.ts b/frontend/src/app/components/accelerator-dashboard/accelerator-dashboard.component.ts index aaf7be825..8257c3306 100644 --- a/frontend/src/app/components/accelerator-dashboard/accelerator-dashboard.component.ts +++ b/frontend/src/app/components/accelerator-dashboard/accelerator-dashboard.component.ts @@ -56,10 +56,10 @@ export class AcceleratorDashboardComponent implements OnInit { switchMap(([blocks, accelerations]) => { const accelerationsByBlock: { [ hash: string ]: Acceleration[] } = {}; for (const acceleration of accelerations) { - if (acceleration.mined && !accelerationsByBlock[acceleration.blockHash]) { + if (['mined', 'completed'].includes(acceleration.status) && !accelerationsByBlock[acceleration.blockHash]) { accelerationsByBlock[acceleration.blockHash] = []; } - if (acceleration.mined) { + if (['mined', 'completed'].includes(acceleration.status)) { accelerationsByBlock[acceleration.blockHash].push(acceleration); } } diff --git a/frontend/src/app/graphs/graphs.routing.module.ts b/frontend/src/app/graphs/graphs.routing.module.ts index a3e84db69..12eeb6e4c 100644 --- a/frontend/src/app/graphs/graphs.routing.module.ts +++ b/frontend/src/app/graphs/graphs.routing.module.ts @@ -18,6 +18,7 @@ import { StatisticsComponent } from '../components/statistics/statistics.compone import { TelevisionComponent } from '../components/television/television.component'; import { DashboardComponent } from '../dashboard/dashboard.component'; import { AccelerationFeesGraphComponent } from '../components/acceleration-fees-graph/acceleration-fees-graph.component'; +import { AccelerationsListComponent } from '../components/accelerations-list/accelerations-list.component'; const routes: Routes = [ { @@ -50,6 +51,11 @@ const routes: Routes = [ } ] }, + { + path: 'acceleration-list', + data: { networks: ['bitcoin'] }, + component: AccelerationsListComponent, + }, { path: 'mempool-block/:id', data: { networks: ['bitcoin', 'liquid'] },