retry firstseen on error

fixes #5340
This commit is contained in:
softsimon 2024-07-14 20:44:13 +09:00
parent 6177b97bd1
commit 9cba7ccf75
No known key found for this signature in database
GPG Key ID: 488D7DCFB5A430D7
2 changed files with 10 additions and 1 deletions

View File

@ -481,7 +481,7 @@
<td i18n="transaction.first-seen|Transaction first seen">First seen</td>
<td><i><app-time kind="since" [time]="transactionTime" [fastRender]="true" [showTooltip]="true"></app-time></i></td>
</tr>
} @else {
} @else if (isLoadingFirstSeen) {
<tr>
<td i18n="transaction.first-seen|Transaction first seen">First seen</td>
<td><span class="skeleton-loader"></span></td>

View File

@ -133,6 +133,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
isMobile: boolean;
firstLoad = true;
waitingForAccelerationInfo: boolean = false;
isLoadingFirstSeen = false;
featuresEnabled: boolean;
segwitEnabled: boolean;
@ -763,8 +764,16 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
}
getTransactionTime() {
this.isLoadingFirstSeen = true;
this.apiService
.getTransactionTimes$([this.tx.txid])
.pipe(
retry({ count: 2, delay: 2000 }),
catchError(() => {
this.isLoadingFirstSeen = false;
return throwError(() => new Error(''));
})
)
.subscribe((transactionTimes) => {
if (transactionTimes?.length && transactionTimes[0]) {
this.transactionTime = transactionTimes[0];