@@ -10,8 +10,7 @@
|
||||
<ng-template [ngIf]="isLoading">
|
||||
<div class="loading-block">
|
||||
<h3>Waiting for blocks...</h3>
|
||||
<br>
|
||||
<div class="spinner-border text-light"></div>
|
||||
<div class="spinner-border text-light mt-2"></div>
|
||||
</div>
|
||||
</ng-template>
|
||||
|
||||
|
||||
@@ -1,21 +1,28 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component, OnInit, OnDestroy } from '@angular/core';
|
||||
import { StateService } from 'src/app/services/state.service';
|
||||
import { Subscription } from 'rxjs';
|
||||
|
||||
@Component({
|
||||
selector: 'app-blockchain',
|
||||
templateUrl: './blockchain.component.html',
|
||||
styleUrls: ['./blockchain.component.scss']
|
||||
})
|
||||
export class BlockchainComponent implements OnInit {
|
||||
export class BlockchainComponent implements OnInit, OnDestroy {
|
||||
txTrackingLoading = false;
|
||||
txShowTxNotFound = false;
|
||||
isLoading = true;
|
||||
subscription: Subscription;
|
||||
|
||||
constructor(
|
||||
private stateService: StateService,
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.stateService.blocks$.subscribe(() => this.isLoading = false);
|
||||
this.subscription = this.stateService.isLoadingWebSocket$
|
||||
.subscribe((isLoading) => this.isLoading = isLoading);
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.subscription.unsubscribe();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ export class MempoolBlocksComponent implements OnInit, OnDestroy {
|
||||
|
||||
this.stateService.blocks$
|
||||
.subscribe(([block]) => {
|
||||
if (block.matchRate >= 80 && !this.tabHidden) {
|
||||
if (block.matchRate >= 66 && !this.tabHidden) {
|
||||
this.blockIndex++;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user