From 3bdc92404b828d2b409ecb092a76bf312722fd89 Mon Sep 17 00:00:00 2001 From: nymkappa <1612910616@pm.me> Date: Sun, 7 Sep 2025 18:29:09 +0200 Subject: [PATCH 1/2] [accelerator] we don't need to start a new price subscription at checkout --- .../accelerate-checkout.component.ts | 31 +++++-------------- 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts b/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts index 4d9938bcc..f6f362b90 100644 --- a/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts +++ b/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts @@ -479,14 +479,12 @@ export class AccelerateCheckout implements OnInit, OnDestroy { } this.processing = true; - this.conversionsSubscription = this.stateService.conversions$.subscribe( - async (conversions) => { - this.conversions = conversions; + if (this.applePay) { this.applePay.destroy(); } - const costUSD = this.cost / 100_000_000 * conversions.USD; + const costUSD = this.cost / 100_000_000 * this.conversions.USD; const paymentRequest = this.payments.paymentRequest({ countryCode: 'US', currencyCode: 'USD', @@ -585,8 +583,6 @@ export class AccelerateCheckout implements OnInit, OnDestroy { this.processing = false; console.error(e); } - } - ); } /** @@ -601,14 +597,12 @@ export class AccelerateCheckout implements OnInit, OnDestroy { } this.processing = true; - this.conversionsSubscription = this.stateService.conversions$.subscribe( - async (conversions) => { - this.conversions = conversions; + if (this.googlePay) { this.googlePay.destroy(); } - const costUSD = this.cost / 100_000_000 * conversions.USD; + const costUSD = this.cost / 100_000_000 * this.conversions.USD; const paymentRequest = this.payments.paymentRequest({ countryCode: 'US', currencyCode: 'USD', @@ -710,8 +704,6 @@ export class AccelerateCheckout implements OnInit, OnDestroy { this.isCheckoutLocked--; } }); - } - ); } /** @@ -726,11 +718,8 @@ export class AccelerateCheckout implements OnInit, OnDestroy { } this.processing = true; - this.conversionsSubscription = this.stateService.conversions$.subscribe( - async (conversions) => { - this.conversions = conversions; - const costUSD = this.cost / 100_000_000 * conversions.USD; + const costUSD = this.cost / 100_000_000 * this.conversions.USD; if (this.isCheckoutLocked > 0) { return; } @@ -815,8 +804,6 @@ export class AccelerateCheckout implements OnInit, OnDestroy { this.isCheckoutLocked--; this.isTokenizing--; } - } - ); } /** @@ -831,15 +818,13 @@ export class AccelerateCheckout implements OnInit, OnDestroy { } this.processing = true; - this.conversionsSubscription = this.stateService.conversions$.subscribe( - async (conversions) => { - this.conversions = conversions; + if (this.cashAppPay) { this.cashAppPay.destroy(); } const redirectHostname = document.location.hostname === 'localhost' ? `http://localhost:4200`: `https://${document.location.hostname}`; - const costUSD = this.cost / 100_000_000 * conversions.USD; + const costUSD = this.cost / 100_000_000 * this.conversions.USD; const paymentRequest = this.payments.paymentRequest({ countryCode: 'US', currencyCode: 'USD', @@ -902,8 +887,6 @@ export class AccelerateCheckout implements OnInit, OnDestroy { }); } }); - } - ); } /** From 27e88920c7e60609cee41b8a6e4ab29b4b82c989 Mon Sep 17 00:00:00 2001 From: nymkappa <1612910616@pm.me> Date: Mon, 8 Sep 2025 18:22:17 +0200 Subject: [PATCH 2/2] [accelerator] we don't need to stop the price subscription --- .../accelerate-checkout.component.ts | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts b/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts index f6f362b90..9cb563a68 100644 --- a/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts +++ b/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts @@ -474,9 +474,6 @@ export class AccelerateCheckout implements OnInit, OnDestroy { if (this.processing) { return; } - if (this.conversionsSubscription) { - this.conversionsSubscription.unsubscribe(); - } this.processing = true; @@ -592,9 +589,6 @@ export class AccelerateCheckout implements OnInit, OnDestroy { if (this.processing) { return; } - if (this.conversionsSubscription) { - this.conversionsSubscription.unsubscribe(); - } this.processing = true; @@ -713,9 +707,6 @@ export class AccelerateCheckout implements OnInit, OnDestroy { if (this.processing) { return; } - if (this.conversionsSubscription) { - this.conversionsSubscription.unsubscribe(); - } this.processing = true; @@ -813,9 +804,6 @@ export class AccelerateCheckout implements OnInit, OnDestroy { if (this.processing) { return; } - if (this.conversionsSubscription) { - this.conversionsSubscription.unsubscribe(); - } this.processing = true;