mirror of
https://github.com/mempool/mempool.git
synced 2025-03-01 09:10:02 +01:00
41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
import { Component, OnInit, OnDestroy, Input } from '@angular/core';
|
|
import { Subscription } from 'rxjs';
|
|
import { take } from 'rxjs/operators';
|
|
import { StateService } from 'src/app/services/state.service';
|
|
import { Router } from '@angular/router';
|
|
|
|
@Component({
|
|
selector: 'app-blockchain',
|
|
templateUrl: './blockchain.component.html',
|
|
styleUrls: ['./blockchain.component.scss']
|
|
})
|
|
export class BlockchainComponent implements OnInit, OnDestroy {
|
|
@Input() position: 'middle' | 'top' = 'middle';
|
|
@Input() markHeight: number;
|
|
@Input() txFeePerVSize: number;
|
|
@Input() markMempoolBlockIndex = -1;
|
|
|
|
txTrackingSubscription: Subscription;
|
|
blocksSubscription: Subscription;
|
|
|
|
txTrackingLoading = false;
|
|
txShowTxNotFound = false;
|
|
isLoading = true;
|
|
|
|
constructor(
|
|
private stateService: StateService,
|
|
private router: Router,
|
|
) {}
|
|
|
|
ngOnInit() {
|
|
this.blocksSubscription = this.stateService.blocks$
|
|
.pipe(
|
|
take(1)
|
|
)
|
|
.subscribe(() => this.isLoading = false);
|
|
}
|
|
|
|
ngOnDestroy() {
|
|
this.blocksSubscription.unsubscribe();
|
|
}
|
|
}
|