Bugfix: Latestblock height didn't propagate in the template
Renaming Contributors to About
This commit is contained in:
		
							parent
							
								
									c9cc660e54
								
							
						
					
					
						commit
						7e9ba6b983
					
				@ -45,7 +45,7 @@ const routes: Routes = [
 | 
				
			|||||||
        component: StatisticsComponent,
 | 
					        component: StatisticsComponent,
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
        path: 'contributors',
 | 
					        path: 'about',
 | 
				
			||||||
        component: AboutComponent,
 | 
					        component: AboutComponent,
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
@ -98,7 +98,7 @@ const routes: Routes = [
 | 
				
			|||||||
        component: TelevisionComponent,
 | 
					        component: TelevisionComponent,
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
        path: 'contributors',
 | 
					        path: 'about',
 | 
				
			||||||
        component: AboutComponent,
 | 
					        component: AboutComponent,
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
@ -151,7 +151,7 @@ const routes: Routes = [
 | 
				
			|||||||
        component: StatisticsComponent,
 | 
					        component: StatisticsComponent,
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
        path: 'contributors',
 | 
					        path: 'about',
 | 
				
			||||||
        component: AboutComponent,
 | 
					        component: AboutComponent,
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
@ -204,7 +204,7 @@ const routes: Routes = [
 | 
				
			|||||||
        component: StatisticsComponent,
 | 
					        component: StatisticsComponent,
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
        path: 'contributors',
 | 
					        path: 'about',
 | 
				
			||||||
        component: AboutComponent,
 | 
					        component: AboutComponent,
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
 | 
				
			|||||||
@ -33,7 +33,7 @@
 | 
				
			|||||||
        <a class="nav-link" [routerLink]="['/assets' | relativeUrl]" (click)="collapse()">Assets</a>
 | 
					        <a class="nav-link" [routerLink]="['/assets' | relativeUrl]" (click)="collapse()">Assets</a>
 | 
				
			||||||
      </li>
 | 
					      </li>
 | 
				
			||||||
      <li class="nav-item" routerLinkActive="active">
 | 
					      <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>
 | 
					      </li>
 | 
				
			||||||
    </ul>
 | 
					    </ul>
 | 
				
			||||||
    <app-search-form location="top" (searchTriggered)="collapse()"></app-search-form>
 | 
					    <app-search-form location="top" (searchTriggered)="collapse()"></app-search-form>
 | 
				
			||||||
 | 
				
			|||||||
@ -127,7 +127,7 @@
 | 
				
			|||||||
      </div>
 | 
					      </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      <div class="float-right">
 | 
					      <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>
 | 
					          <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>
 | 
					          <ng-template #unconfirmedButton>
 | 
				
			||||||
            <button type="button" class="btn btn-sm btn-danger mt-2">Unconfirmed</button>
 | 
					            <button type="button" class="btn btn-sm btn-danger mt-2">Unconfirmed</button>
 | 
				
			||||||
 | 
				
			|||||||
@ -5,6 +5,7 @@ import { Block, Outspend, Transaction } from '../../interfaces/electrs.interface
 | 
				
			|||||||
import { ElectrsApiService } from '../../services/electrs-api.service';
 | 
					import { ElectrsApiService } from '../../services/electrs-api.service';
 | 
				
			||||||
import { environment } from 'src/environments/environment';
 | 
					import { environment } from 'src/environments/environment';
 | 
				
			||||||
import { AssetsService } from 'src/app/services/assets.service';
 | 
					import { AssetsService } from 'src/app/services/assets.service';
 | 
				
			||||||
 | 
					import { map } from 'rxjs/operators';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@Component({
 | 
					@Component({
 | 
				
			||||||
  selector: 'app-transactions-list',
 | 
					  selector: 'app-transactions-list',
 | 
				
			||||||
@ -22,7 +23,7 @@ export class TransactionsListComponent implements OnInit, OnChanges {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  @Output() loadMore = new EventEmitter();
 | 
					  @Output() loadMore = new EventEmitter();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  latestBlock: Block;
 | 
					  latestBlock$: Observable<Block>;
 | 
				
			||||||
  outspends: Outspend[] = [];
 | 
					  outspends: Outspend[] = [];
 | 
				
			||||||
  assetsMinimal: any;
 | 
					  assetsMinimal: any;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -34,7 +35,7 @@ export class TransactionsListComponent implements OnInit, OnChanges {
 | 
				
			|||||||
  ) { }
 | 
					  ) { }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ngOnInit() {
 | 
					  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);
 | 
					    this.stateService.networkChanged$.subscribe((network) => this.network = network);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (this.network === 'liquid') {
 | 
					    if (this.network === 'liquid') {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user