Skip to content

Commit

Permalink
Fix Get Fee Estimate and result icons
Browse files Browse the repository at this point in the history
  • Loading branch information
everoddandeven committed Oct 27, 2024
1 parent 7ade17e commit ad99acc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/app/pages/bans/bans.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ <h4 class="mb-3">Ban another node by IP</h4>
<div class="row g-5 p-2">
<div class="col-md-7 col-lg-12">
<div *ngIf="setBansSuccess" class="alert alert-success d-flex align-items-center justify-content-center text-center" role="alert">
<h4><i class="bi bi-send-check m-2"></i></h4>&nbsp;&nbsp;
<h4><i class="bi bi-check-circle m-2"></i></h4>&nbsp;&nbsp;
<div>
Successfully set bans
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/app/pages/transactions/transactions.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ <h4 class="mb-3">Get coinbase tx sum</h4>

<div class="tab-pane fade" id="pills-flush-tx-pool" role="tabpanel" aria-labelledby="pills-flush-tx-pool-tab" tabindex="0">
<div *ngIf="flushSuccess" class="alert alert-success d-flex align-items-center justify-content-center text-center" role="alert">
<h4><i class="bi bi-send-check m-2"></i></h4>&nbsp;&nbsp;
<h4><i class="bi bi-check-circle m-2"></i></h4>&nbsp;&nbsp;
<div>
Successfully flushed txs
</div>
Expand Down Expand Up @@ -322,7 +322,7 @@ <h4 class="mb-3">Flush a list of transaction IDs</h4>

<div class="tab-pane fade" id="pills-flush-cache" role="tabpanel" aria-labelledby="pills-flush-cache-tab" tabindex="0">
<div *ngIf="flushCacheSuccess" class="alert alert-success d-flex align-items-center justify-content-center text-center" role="alert">
<h4><i class="bi bi-send-check m-2"></i></h4>&nbsp;&nbsp;
<h4><i class="bi bi-check-circle m-2"></i></h4>&nbsp;&nbsp;
<div>
Successfully flushed cache
</div>
Expand Down
15 changes: 10 additions & 5 deletions src/app/pages/transactions/transactions.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,14 +310,19 @@ export class TransactionsComponent extends BasePageComponent implements AfterVie
this.feeEstimateCards = [
new SimpleBootstrapCard('Fee Per Byte', `${this.getFeeEstimateResult.fee}`),
new SimpleBootstrapCard('Quantization Mask', `${this.getFeeEstimateResult.quantizationMask}`),
new SimpleBootstrapCard('Fee (slow)', `${this.getFeeEstimateResult.fees[0]}`),
new SimpleBootstrapCard('Fee (normal)', `${this.getFeeEstimateResult.fees[1]}`),
new SimpleBootstrapCard('Fee (fast)', `${this.getFeeEstimateResult.fees[2]}`),
new SimpleBootstrapCard('Fee (fastest)', `${this.getFeeEstimateResult.fees[3]}`)
];

if (this.getFeeEstimateResult.fees.length > 0) {
this.feeEstimateCards.push(
new SimpleBootstrapCard('Fee (slow)', `${this.getFeeEstimateResult.fees[0]}`),
new SimpleBootstrapCard('Fee (normal)', `${this.getFeeEstimateResult.fees[1]}`),
new SimpleBootstrapCard('Fee (fast)', `${this.getFeeEstimateResult.fees[2]}`),
new SimpleBootstrapCard('Fee (fastest)', `${this.getFeeEstimateResult.fees[3]}`)
);
}

this.getFeeEstimateSuccess = true;
this.getFeeEstimateError = ``;

}
catch(error: any) {
console.error(error);
Expand Down
2 changes: 1 addition & 1 deletion src/common/FeeEstimate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class FeeEstimate {

public static parse(estimate: any): FeeEstimate {
const fee: number = estimate.fee;
const fees: number[] = estimate.fees;
const fees: number[] = estimate.fees ? estimate.fees : [];
const quantizationMask: number = estimate.quantization_mask;

return new FeeEstimate(fee, fees, quantizationMask);
Expand Down

0 comments on commit ad99acc

Please sign in to comment.