Bugfix: Latestblock height didn't propagate in the template

Renaming Contributors to About
This commit is contained in:
softsimon 2020-06-21 14:55:16 +07:00
parent c9cc660e54
commit 7e9ba6b983
No known key found for this signature in database
GPG Key ID: 488D7DCFB5A430D7
4 changed files with 9 additions and 8 deletions

View File

@ -45,7 +45,7 @@ const routes: Routes = [
component: StatisticsComponent,
},
{
path: 'contributors',
path: 'about',
component: AboutComponent,
},
{
@ -98,7 +98,7 @@ const routes: Routes = [
component: TelevisionComponent,
},
{
path: 'contributors',
path: 'about',
component: AboutComponent,
},
{
@ -151,7 +151,7 @@ const routes: Routes = [
component: StatisticsComponent,
},
{
path: 'contributors',
path: 'about',
component: AboutComponent,
},
{
@ -204,7 +204,7 @@ const routes: Routes = [
component: StatisticsComponent,
},
{
path: 'contributors',
path: 'about',
component: AboutComponent,
},
{

View File

@ -33,7 +33,7 @@
<a class="nav-link" [routerLink]="['/assets' | relativeUrl]" (click)="collapse()">Assets</a>
</li>
<li class="nav-item" routerLinkActive="active">
<a class="nav-link" [routerLink]="['/contributors' | relativeUrl]" (click)="collapse()">About</a>
<a class="nav-link" [routerLink]="['/about' | relativeUrl]" (click)="collapse()">About</a>
</li>
</ul>
<app-search-form location="top" (searchTriggered)="collapse()"></app-search-form>

View File

@ -127,7 +127,7 @@
</div>
<div class="float-right">
<span *ngIf="showConfirmations && latestBlock">
<span *ngIf="showConfirmations && latestBlock$ | async as latestBlock">
<button *ngIf="tx.status.confirmed; else unconfirmedButton" type="button" class="btn btn-sm btn-success mt-2">{{ latestBlock.height - tx.status.block_height + 1 }} confirmation<ng-container *ngIf="latestBlock.height - tx.status.block_height + 1 > 1">s</ng-container></button>
<ng-template #unconfirmedButton>
<button type="button" class="btn btn-sm btn-danger mt-2">Unconfirmed</button>

View File

@ -5,6 +5,7 @@ import { Block, Outspend, Transaction } from '../../interfaces/electrs.interface
import { ElectrsApiService } from '../../services/electrs-api.service';
import { environment } from 'src/environments/environment';
import { AssetsService } from 'src/app/services/assets.service';
import { map } from 'rxjs/operators';
@Component({
selector: 'app-transactions-list',
@ -22,7 +23,7 @@ export class TransactionsListComponent implements OnInit, OnChanges {
@Output() loadMore = new EventEmitter();
latestBlock: Block;
latestBlock$: Observable<Block>;
outspends: Outspend[] = [];
assetsMinimal: any;
@ -34,7 +35,7 @@ export class TransactionsListComponent implements OnInit, OnChanges {
) { }
ngOnInit() {
this.stateService.blocks$.subscribe(([block]) => this.latestBlock = block);
this.latestBlock$ = this.stateService.blocks$.pipe(map(([block]) => block));
this.stateService.networkChanged$.subscribe((network) => this.network = network);
if (this.network === 'liquid') {