mirror of
https://github.com/mempool/mempool.git
synced 2025-04-01 00:18:05 +02:00
Merge pull request #5356 from mempool/simon/fix-payment-waiting-retry
fix btc payment waiting reply
This commit is contained in:
commit
6bc52dcc82
@ -3,7 +3,7 @@ import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { DomSanitizer, SafeUrl } from '@angular/platform-browser';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { Subscription, of, timer } from 'rxjs';
|
||||
import { retry, switchMap, tap } from 'rxjs/operators';
|
||||
import { filter, repeat, retry, switchMap, take, tap } from 'rxjs/operators';
|
||||
import { ServicesApiServices } from '../../services/services-api.service';
|
||||
|
||||
@Component({
|
||||
@ -73,11 +73,11 @@ export class BitcoinInvoiceComponent implements OnInit, OnChanges, OnDestroy {
|
||||
this.paymentStatus = 4;
|
||||
}
|
||||
this.paymentStatusSubscription = this.apiService.getPaymentStatus$(this.invoice.btcpayInvoiceId).pipe(
|
||||
retry({ delay: () => timer(2000)})
|
||||
).subscribe((response) => {
|
||||
if (response.status === 204 || response.status === 404) {
|
||||
return;
|
||||
}
|
||||
retry({ delay: () => timer(2000)}),
|
||||
repeat({delay: 2000}),
|
||||
filter((response) => response.status !== 204 && response.status !== 404),
|
||||
take(1),
|
||||
).subscribe(() => {
|
||||
this.paymentStatus = 3;
|
||||
this.completed.emit();
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user