Fix acceleration dashboard merge issues
This commit is contained in:
parent
b0e73466fa
commit
f26b630aab
@ -98,7 +98,7 @@ export class AccelerationFeesGraphComponent implements OnInit {
|
|||||||
this.isLoading = true;
|
this.isLoading = true;
|
||||||
this.storageService.setValue('miningWindowPreference', timespan);
|
this.storageService.setValue('miningWindowPreference', timespan);
|
||||||
this.timespan = timespan;
|
this.timespan = timespan;
|
||||||
return this.apiService.getAccelerations$();
|
return this.apiService.getAccelerationHistory$();
|
||||||
})
|
})
|
||||||
),
|
),
|
||||||
this.radioGroupForm.get('dateSpan').valueChanges.pipe(
|
this.radioGroupForm.get('dateSpan').valueChanges.pipe(
|
||||||
@ -128,11 +128,11 @@ export class AccelerationFeesGraphComponent implements OnInit {
|
|||||||
const blockAccelerations = {};
|
const blockAccelerations = {};
|
||||||
|
|
||||||
for (const acceleration of accelerations) {
|
for (const acceleration of accelerations) {
|
||||||
if (acceleration.mined) {
|
if (acceleration.status === 'mined' || acceleration.status === 'completed') {
|
||||||
if (!blockAccelerations[acceleration.block_height]) {
|
if (!blockAccelerations[acceleration.blockHeight]) {
|
||||||
blockAccelerations[acceleration.block_height] = [];
|
blockAccelerations[acceleration.blockHeight] = [];
|
||||||
}
|
}
|
||||||
blockAccelerations[acceleration.block_height].push(acceleration);
|
blockAccelerations[acceleration.blockHeight].push(acceleration);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
{{ acceleration.feeDelta | number }} <span class="symbol" i18n="shared.sat|sat">sat</span>
|
{{ acceleration.feeDelta | number }} <span class="symbol" i18n="shared.sat|sat">sat</span>
|
||||||
</td>
|
</td>
|
||||||
<td class="status text-right">
|
<td class="status text-right">
|
||||||
|
<span *ngIf="acceleration.status === 'accelerating'" class="badge badge-warning" i18n="transaction.rbf.mined">Pending</span>
|
||||||
<span *ngIf="acceleration.status === 'mined' || acceleration.status === 'completed'" class="badge badge-success" i18n="transaction.rbf.mined">Mined</span>
|
<span *ngIf="acceleration.status === 'mined' || acceleration.status === 'completed'" class="badge badge-success" i18n="transaction.rbf.mined">Mined</span>
|
||||||
<span *ngIf="acceleration.status === 'failed'" class="badge badge-danger" i18n="accelerator.canceled">Canceled</span>
|
<span *ngIf="acceleration.status === 'failed'" class="badge badge-danger" i18n="accelerator.canceled">Canceled</span>
|
||||||
</td>
|
</td>
|
||||||
|
@ -39,12 +39,12 @@ export class AccelerationsListComponent implements OnInit {
|
|||||||
this.skeletonLines = this.widget === true ? [...Array(6).keys()] : [...Array(15).keys()];
|
this.skeletonLines = this.widget === true ? [...Array(6).keys()] : [...Array(15).keys()];
|
||||||
this.paginationMaxSize = window.matchMedia('(max-width: 670px)').matches ? 3 : 5;
|
this.paginationMaxSize = window.matchMedia('(max-width: 670px)').matches ? 3 : 5;
|
||||||
|
|
||||||
this.accelerations$ = this.apiService.getAccelerations$().pipe(
|
this.accelerations$ = this.apiService.getAccelerationHistory$().pipe(
|
||||||
switchMap(accelerations => {
|
switchMap(accelerations => {
|
||||||
if (this.widget) {
|
if (this.widget) {
|
||||||
return of(accelerations.slice(0, 6));
|
return of(accelerations.slice(-6).reverse());
|
||||||
} else {
|
} else {
|
||||||
return of(accelerations);
|
return of(accelerations.reverse());
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
catchError((err) => {
|
catchError((err) => {
|
||||||
|
@ -56,10 +56,10 @@ export class AcceleratorDashboardComponent implements OnInit {
|
|||||||
switchMap(([blocks, accelerations]) => {
|
switchMap(([blocks, accelerations]) => {
|
||||||
const accelerationsByBlock: { [ hash: string ]: Acceleration[] } = {};
|
const accelerationsByBlock: { [ hash: string ]: Acceleration[] } = {};
|
||||||
for (const acceleration of accelerations) {
|
for (const acceleration of accelerations) {
|
||||||
if (acceleration.mined && !accelerationsByBlock[acceleration.blockHash]) {
|
if (['mined', 'completed'].includes(acceleration.status) && !accelerationsByBlock[acceleration.blockHash]) {
|
||||||
accelerationsByBlock[acceleration.blockHash] = [];
|
accelerationsByBlock[acceleration.blockHash] = [];
|
||||||
}
|
}
|
||||||
if (acceleration.mined) {
|
if (['mined', 'completed'].includes(acceleration.status)) {
|
||||||
accelerationsByBlock[acceleration.blockHash].push(acceleration);
|
accelerationsByBlock[acceleration.blockHash].push(acceleration);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@ import { StatisticsComponent } from '../components/statistics/statistics.compone
|
|||||||
import { TelevisionComponent } from '../components/television/television.component';
|
import { TelevisionComponent } from '../components/television/television.component';
|
||||||
import { DashboardComponent } from '../dashboard/dashboard.component';
|
import { DashboardComponent } from '../dashboard/dashboard.component';
|
||||||
import { AccelerationFeesGraphComponent } from '../components/acceleration-fees-graph/acceleration-fees-graph.component';
|
import { AccelerationFeesGraphComponent } from '../components/acceleration-fees-graph/acceleration-fees-graph.component';
|
||||||
|
import { AccelerationsListComponent } from '../components/accelerations-list/accelerations-list.component';
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{
|
{
|
||||||
@ -50,6 +51,11 @@ const routes: Routes = [
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'acceleration-list',
|
||||||
|
data: { networks: ['bitcoin'] },
|
||||||
|
component: AccelerationsListComponent,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: 'mempool-block/:id',
|
path: 'mempool-block/:id',
|
||||||
data: { networks: ['bitcoin', 'liquid'] },
|
data: { networks: ['bitcoin', 'liquid'] },
|
||||||
|
Loading…
x
Reference in New Issue
Block a user