Fix ETA loading error
This commit is contained in:
parent
14e05b43c7
commit
a0402b92f9
@ -68,7 +68,7 @@
|
|||||||
<h5 *ngIf="estimate?.pools?.length" i18n="accelerator.how-much-faster">How much faster?</h5>
|
<h5 *ngIf="estimate?.pools?.length" i18n="accelerator.how-much-faster">How much faster?</h5>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<ng-container *ngIf="(etaInfo$ | async) as etaInfo">
|
<ng-container *ngIf="(etaInfo$ | async) as etaInfo; else loadingEstimate">
|
||||||
<small class="form-text text-muted mb-2" i18n="accelerator.hashrate-percentage-description">Your transaction will be prioritized by up to {{ etaInfo.hashratePercentage | number : '1.1-1' }}% of miners.</small>
|
<small class="form-text text-muted mb-2" i18n="accelerator.hashrate-percentage-description">Your transaction will be prioritized by up to {{ etaInfo.hashratePercentage | number : '1.1-1' }}% of miners.</small>
|
||||||
<small class="form-text text-muted mb-2" i18n="accelerator.time-estimate-description">This will reduce your expected waiting time until the first confirmation to <app-time kind="within" [time]="etaInfo.acceleratedETA" [fastRender]="false" [fixedRender]="true"></app-time></small>
|
<small class="form-text text-muted mb-2" i18n="accelerator.time-estimate-description">This will reduce your expected waiting time until the first confirmation to <app-time kind="within" [time]="etaInfo.acceleratedETA" [fastRender]="false" [fixedRender]="true"></app-time></small>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
@ -78,6 +78,10 @@ export class TimeComponent implements OnInit, OnChanges, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
calculate() {
|
calculate() {
|
||||||
|
if (!this.time) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let seconds: number;
|
let seconds: number;
|
||||||
switch (this.kind) {
|
switch (this.kind) {
|
||||||
case 'since':
|
case 'since':
|
||||||
|
@ -26,7 +26,7 @@ export class EtaService {
|
|||||||
|
|
||||||
getProjectedEtaObservable(estimate: AccelerationEstimate, miningStats?: MiningStats): Observable<{ hashratePercentage: number, ETA: number, acceleratedETA: number }> {
|
getProjectedEtaObservable(estimate: AccelerationEstimate, miningStats?: MiningStats): Observable<{ hashratePercentage: number, ETA: number, acceleratedETA: number }> {
|
||||||
return combineLatest([
|
return combineLatest([
|
||||||
this.stateService.mempoolTxPosition$.pipe(map(p => p.position)),
|
this.stateService.mempoolTxPosition$.pipe(map(p => p?.position)),
|
||||||
this.stateService.difficultyAdjustment$,
|
this.stateService.difficultyAdjustment$,
|
||||||
miningStats ? of(miningStats) : this.miningService.getMiningStats('1w'),
|
miningStats ? of(miningStats) : this.miningService.getMiningStats('1w'),
|
||||||
]).pipe(
|
]).pipe(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user