Fix ETA loading error

This commit is contained in:
softsimon 2024-06-26 12:12:49 +09:00
parent 14e05b43c7
commit a0402b92f9
No known key found for this signature in database
GPG Key ID: 488D7DCFB5A430D7
3 changed files with 6 additions and 2 deletions

View File

@ -68,7 +68,7 @@
<h5 *ngIf="estimate?.pools?.length" i18n="accelerator.how-much-faster">How much faster?</h5>
<div class="row">
<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.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>

View File

@ -78,6 +78,10 @@ export class TimeComponent implements OnInit, OnChanges, OnDestroy {
}
calculate() {
if (!this.time) {
return;
}
let seconds: number;
switch (this.kind) {
case 'since':

View File

@ -26,7 +26,7 @@ export class EtaService {
getProjectedEtaObservable(estimate: AccelerationEstimate, miningStats?: MiningStats): Observable<{ hashratePercentage: number, ETA: number, acceleratedETA: number }> {
return combineLatest([
this.stateService.mempoolTxPosition$.pipe(map(p => p.position)),
this.stateService.mempoolTxPosition$.pipe(map(p => p?.position)),
this.stateService.difficultyAdjustment$,
miningStats ? of(miningStats) : this.miningService.getMiningStats('1w'),
]).pipe(