Fix concurrent asynchronous calls. (#675)

* Fix concurrent asynchronous calls.

* Remove test without mempool info websocket.

* Remove isloading$ variable.
This commit is contained in:
Miguel Medeiros
2021-07-31 13:40:15 -03:00
committed by GitHub
parent 156fe8837c
commit 11af9e6033
10 changed files with 24 additions and 32 deletions

View File

@@ -1,4 +1,4 @@
<div class="mempool-blocks-container" *ngIf="(isLoading$ | async) === false">
<div class="mempool-blocks-container">
<div class="flashing" *ngIf="(timeAvg$ | async) as timeAvg;">
<ng-template ngFor let-projectedBlock [ngForOf]="mempoolBlocks$ | async" let-i="index" [ngForTrackBy]="trackByFn">
<div class="bitcoin-block text-center mempool-block" id="mempool-block-{{ i }}" [ngStyle]="mempoolBlockStyles[i]">
@@ -38,7 +38,7 @@
<div *ngIf="arrowVisible" id="arrow-up" [ngStyle]="{'right': rightPosition + 75 + 'px', transition: transition }"></div>
</div>
<div class="mempool-blocks-container" *ngIf="(isLoading$ | async) === true">
<div class="mempool-blocks-container" *ngIf="loadingMempoolBlocks === true">
<div class="flashing">
<ng-template ngFor let-projectedBlock [ngForOf]="mempoolBlocks" let-i="index" [ngForTrackBy]="trackByFn">
<div class="bitcoin-block text-center mempool-block" id="mempool-block-{{ i }}" [ngStyle]="mempoolBlockStyles[i]"></div>

View File

@@ -13,7 +13,6 @@ import { feeLevels, mempoolFeeColors } from 'src/app/app.constants';
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class MempoolBlocksComponent implements OnInit, OnDestroy {
@Input() isLoading$: Observable<boolean>;
mempoolBlocks: MempoolBlock[] = this.mountEmptyBlocks();
mempoolBlocks$: Observable<MempoolBlock[]>;
@@ -31,6 +30,7 @@ export class MempoolBlocksComponent implements OnInit, OnDestroy {
blockPadding = 30;
arrowVisible = false;
tabHidden = false;
loadingMempoolBlocks = true;
rightPosition = 0;
transition = '2s';
@@ -106,6 +106,7 @@ export class MempoolBlocksComponent implements OnInit, OnDestroy {
timeAvgMins += Math.abs(timeAvgDiff);
}
this.loadingMempoolBlocks = false;
return timeAvgMins * 60 * 1000;
})
);