Show skeleton loader instead of "Loading transaction..."

This commit is contained in:
Mononaut 2023-07-12 17:43:48 +09:00
parent 55cc3a0c07
commit 132923e7db
No known key found for this signature in database
GPG key ID: A3F058E41374C04E
2 changed files with 5 additions and 13 deletions

View file

@ -306,7 +306,7 @@
</ng-template>
<ng-template [ngIf]="isLoadingTx && !error">
<ng-template [ngIf]="(isLoadingTx && !error) || loadingCachedTx">
<div class="box">
<div class="row">
@ -451,21 +451,14 @@
</ng-template>
<ng-template [ngIf]="error">
<ng-template [ngIf]="error && !loadingCachedTx">
<div class="text-center" *ngIf="loadingCachedTx; else waitingTemplate">
<h3 i18n="transaction.error.loading-transaction">Loading transaction</h3>
<div class="text-center" *ngIf="waitingForTransaction; else errorTemplate">
<h3 i18n="transaction.error.transaction-not-found">Transaction not found.</h3>
<h5 i18n="transaction.error.waiting-for-it-to-appear">Waiting for it to appear in the mempool...</h5>
<div class="spinner-border text-light mt-2"></div>
</div>
<ng-template #waitingTemplate>
<div class="text-center" *ngIf="waitingForTransaction; else errorTemplate">
<h3 i18n="transaction.error.transaction-not-found">Transaction not found.</h3>
<h5 i18n="transaction.error.waiting-for-it-to-appear">Waiting for it to appear in the mempool...</h5>
<div class="spinner-border text-light mt-2"></div>
</div>
</ng-template>
<ng-template #errorTemplate>
<div class="text-center">
<h3>{{ error.error }}</h3>

View file

@ -226,7 +226,6 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
this.tx.feePerVsize = tx.fee / (tx.weight / 4);
this.isLoadingTx = false;
this.error = undefined;
this.loadingCachedTx = false;
this.waitingForTransaction = false;
this.graphExpanded = false;
this.transactionTime = tx.firstSeen || 0;