Address page: Display load more button on load error. (#542)

fixes #440
This commit is contained in:
softsimon authored and GitHub committed 2021-06-06 16:07:45 -04:00
1 parent 5ab470a670
commit 43c9072cad
3 files changed
+13 -1

No files matched your search

@@ -80,6 +80,11 @@
</ng-container>
</ng-template>
<ng-template [ngIf]="retryLoadmore">
<br>
<button type="button" class="btn btn-outline-info btn-sm" (click)="loadMore()"><fa-icon [icon]="['fas', 'redo-alt']" [fixedWidth]="true"></fa-icon></button>
</ng-template>
</div>
</ng-template>
@@ -23,6 +23,7 @@ export class AddressComponent implements OnInit, OnDestroy {
isLoadingAddress = true;
transactions: Transaction[];
isLoadingTransactions = true;
retryLoadmore = false;
error: any;
mainSubscription: Subscription;
addressLoadingStatus$: Observable<number>;
@@ -183,12 +184,17 @@ export class AddressComponent implements OnInit, OnDestroy {
return;
}
this.isLoadingTransactions = true;
this.retryLoadmore = false;
this.electrsApiService.getAddressTransactionsFromHash$(this.address.address, this.lastTransactionTxId)
.subscribe((transactions: Transaction[]) => {
this.lastTransactionTxId = transactions[transactions.length - 1].txid;
this.loadedConfirmedTxCount += transactions.length;
this.transactions = this.transactions.concat(transactions);
this.isLoadingTransactions = false;
},
(error) => {
this.isLoadingTransactions = false;
this.retryLoadmore = true;
});
}