[accelerator] waitlisted & preview-only screens

This commit is contained in:
Mononaut
2024-06-29 07:04:08 +00:00
parent 84d4eaa932
commit 3720d67666
2 changed files with 36 additions and 19 deletions

View File

@@ -232,6 +232,10 @@ export class AccelerateCheckout implements OnInit, OnDestroy {
}
this.cost = this.userBid + this.estimate.mempoolBaseFee + this.estimate.vsizeFee;
if (!this.canPay && this.advancedEnabled && this.step !== 'quote') {
this.moveToStep('quote');
}
if (this.step === 'checkout' && this.canPayWithBitcoin && !this.loadingBtcpayInvoice) {
this.loadingBtcpayInvoice = true;
this.requestBTCPayInvoice();
@@ -266,14 +270,16 @@ export class AccelerateCheckout implements OnInit, OnDestroy {
* Advanced mode acceleration button clicked
*/
accelerate(): void {
if (this.isLoggedIn()) {
if (this.step !== 'summary') {
this.moveToStep('summary');
if (this.canPay) {
if (this.isLoggedIn()) {
if (this.step !== 'summary') {
this.moveToStep('summary');
} else {
this.accelerateWithMempoolAccount();
}
} else {
this.accelerateWithMempoolAccount();
this.moveToStep('checkout');
}
} else {
this.moveToStep('checkout');
}
}
@@ -471,11 +477,15 @@ export class AccelerateCheckout implements OnInit, OnDestroy {
}
get canPayWithCashapp() {
return this.cashappEnabled && this.estimate?.availablePaymentMethods?.includes('bitcoin');
return this.cashappEnabled && this.estimate?.availablePaymentMethods?.includes('cashapp');
}
get canPayWithBalance() {
return this.isLoggedIn() && this.estimate?.availablePaymentMethods?.includes('balance');
return this.isLoggedIn() && this.estimate?.availablePaymentMethods?.includes('balance') && this.estimate?.hasAccess;
}
get canPay() {
return this.canPayWithBalance || this.canPayWithBitcoin || this.canPayWithCashapp;
}
get showSummary() {