Handle confirm transactions not present in the bisq database.

This commit is contained in:
softsimon 2020-07-18 13:09:57 +07:00
parent d22e4a03e6
commit 425f4152b6
No known key found for this signature in database
GPG Key ID: 488D7DCFB5A430D7
3 changed files with 12 additions and 2 deletions

View File

@ -136,7 +136,7 @@
<div class="text-center"> <div class="text-center">
Error loading transaction Error loading transaction
<br> <br><br>
<i>{{ error.status }}: {{ error.statusText }}</i> <i>{{ error.status }}: {{ error.statusText }}</i>
</div> </div>
</ng-template> </ng-template>

View File

@ -50,6 +50,16 @@ export class BisqTransactionComponent implements OnInit, OnDestroy {
if (bisqTxError.status === 404) { if (bisqTxError.status === 404) {
return this.electrsApiService.getTransaction$(this.txId) return this.electrsApiService.getTransaction$(this.txId)
.pipe( .pipe(
map((tx) => {
if (tx.status.confirmed) {
this.error = {
status: 200,
statusText: 'Transaction is confirmed but not available in the Bisq database, please try reloading this page.'
};
return null;
}
return tx;
}),
catchError((txError: HttpErrorResponse) => { catchError((txError: HttpErrorResponse) => {
console.log(txError); console.log(txError);
this.error = txError; this.error = txError;

View File

@ -157,7 +157,7 @@
<ng-template [ngIf]="error"> <ng-template [ngIf]="error">
<div class="text-center"> <div class="text-center">
Error loading block data. Error loading block data.
<br> <br><br>
<i>{{ error.error }}</i> <i>{{ error.error }}</i>
</div> </div>
</ng-template> </ng-template>