From 9488ca50a315c14962df6de8d45d60bb06c322fd Mon Sep 17 00:00:00 2001 From: nymkappa <1612910616@pm.me> Date: Fri, 2 Aug 2024 23:27:40 +0200 Subject: [PATCH 1/2] [square] use mirror to serve square.js and load it sooner --- .../accelerate-checkout/accelerate-checkout.component.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 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 f0674138e..edcb2dfe4 100644 --- a/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts +++ b/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts @@ -204,6 +204,7 @@ export class AccelerateCheckout implements OnInit, OnDestroy { this.fetchEstimate(); } if (this._step === 'checkout') { + this.insertSquare(); this.enterpriseService.goal(8); } if (this._step === 'checkout' && this.canPayWithBitcoin) { @@ -213,17 +214,14 @@ export class AccelerateCheckout implements OnInit, OnDestroy { this.requestBTCPayInvoice(); } else if (this._step === 'cashapp' && this.cashappEnabled) { this.loadingCashapp = true; - this.insertSquare(); this.setupSquare(); this.scrollToElementWithTimeout('confirm-title', 'center', 100); } else if (this._step === 'applepay' && this.applePayEnabled) { this.loadingApplePay = true; - this.insertSquare(); this.setupSquare(); this.scrollToElementWithTimeout('confirm-title', 'center', 100); } else if (this._step === 'googlepay' && this.googlePayEnabled) { this.loadingGooglePay = true; - this.insertSquare(); this.setupSquare(); this.scrollToElementWithTimeout('confirm-title', 'center', 100); } else if (this._step === 'paid') { @@ -409,7 +407,7 @@ export class AccelerateCheckout implements OnInit, OnDestroy { document.location.hostname === 'mempool-staging.fra.mempool.space' || document.location.hostname === 'mempool-staging.tk7.mempool.space' || document.location.hostname === 'mempool.space') { - statsUrl = 'https://web.squarecdn.com/v1/square.js'; + statsUrl = '/square/v1/square/js'; } (function(): void { From 7b45d922bc6d6b92a72ea129a471c4ac8c9af430 Mon Sep 17 00:00:00 2001 From: nymkappa <1612910616@pm.me> Date: Fri, 2 Aug 2024 23:35:30 +0200 Subject: [PATCH 2/2] [square] i'm an idiot --- .../accelerate-checkout/accelerate-checkout.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 edcb2dfe4..5b53fce53 100644 --- a/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts +++ b/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts @@ -407,7 +407,7 @@ export class AccelerateCheckout implements OnInit, OnDestroy { document.location.hostname === 'mempool-staging.fra.mempool.space' || document.location.hostname === 'mempool-staging.tk7.mempool.space' || document.location.hostname === 'mempool.space') { - statsUrl = '/square/v1/square/js'; + statsUrl = '/square/v1/square.js'; } (function(): void {