Liquid: Display block times and amounts correctly.

This commit is contained in:
softsimon
2020-03-25 21:29:40 +07:00
parent 43585be6a9
commit 350a06a096
8 changed files with 33 additions and 6 deletions

View File

@@ -9,7 +9,14 @@
</div>
<div class="block-size">{{ projectedBlock.blockSize | bytes: 2 }}</div>
<div class="transaction-count">{{ projectedBlock.nTx }} transactions</div>
<div class="time-difference" *ngIf="projectedBlock.blockVSize < 1000000">In ~{{ 10 * i + 10 }} minutes</div>
<div class="time-difference" *ngIf="projectedBlock.blockVSize < 1000000">
<ng-template [ngIf]="network === 'liquid'" [ngIfElse]="timeDiffMainnet">
In &lt; {{ 1 * i + 1 }} minute
</ng-template>
<ng-template #timeDiffMainnet>
In ~{{ 10 * i + 10 }} minutes
</ng-template>
</div>
<ng-template [ngIf]="i === mempoolBlocks.length - 1 && projectedBlock.blockVSize >= 1000000">
<div class="time-difference">+{{ projectedBlock.blockVSize / 1000000 | ceil }} blocks</div>
</ng-template>

View File

@@ -4,7 +4,7 @@ import { MempoolBlock } from 'src/app/interfaces/websocket.interface';
import { StateService } from 'src/app/services/state.service';
import { Router } from '@angular/router';
import { take } from 'rxjs/operators';
import { environment } from '../../../environments/environment';
@Component({
selector: 'app-mempool-blocks',
templateUrl: './mempool-blocks.component.html',
@@ -14,6 +14,7 @@ export class MempoolBlocksComponent implements OnInit, OnDestroy {
mempoolBlocks: MempoolBlock[];
mempoolBlocksFull: MempoolBlock[];
mempoolBlocksSubscription: Subscription;
network = environment.network;
blockWidth = 125;
blockPadding = 30;