From 0660296b51505aafbb65760a851267a4e793b28f Mon Sep 17 00:00:00 2001 From: Mononaut Date: Wed, 10 Apr 2024 11:11:53 +0000 Subject: [PATCH 1/2] Disable accelerate button on successful submission --- .../accelerate-preview/accelerate-preview.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html b/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html index 891ffce4a..637eaee1d 100644 --- a/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html +++ b/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html @@ -27,7 +27,7 @@ -
+
You are currently on the waitlist
From 940003552b0e749b04783f91d4f9f09a57839d7f Mon Sep 17 00:00:00 2001 From: Mononaut Date: Wed, 10 Apr 2024 11:12:44 +0000 Subject: [PATCH 2/2] Hide acceleration panel if tx is already accelerated --- .../app/components/transaction/transaction.component.html | 2 +- .../app/components/transaction/transaction.component.ts | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/components/transaction/transaction.component.html b/frontend/src/app/components/transaction/transaction.component.html index 55f7047e6..39c482730 100644 --- a/frontend/src/app/components/transaction/transaction.component.html +++ b/frontend/src/app/components/transaction/transaction.component.html @@ -537,7 +537,7 @@ } @else if (this.mempoolPosition.block >= 7) { In several hours (or more) - @if (!(isMobile && paymentType === 'cashapp') && !tx.acceleration && acceleratorAvailable && accelerateCtaType === 'button' && !tx?.acceleration) { + @if (!(isMobile && paymentType === 'cashapp') && acceleratorAvailable && accelerateCtaType === 'button' && !tx?.acceleration) { Accelerate } diff --git a/frontend/src/app/components/transaction/transaction.component.ts b/frontend/src/app/components/transaction/transaction.component.ts index 158d56c7d..10f61f04a 100644 --- a/frontend/src/app/components/transaction/transaction.component.ts +++ b/frontend/src/app/components/transaction/transaction.component.ts @@ -669,6 +669,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { this.hasEffectiveFeeRate = false; return; } + const firstCpfp = this.cpfpInfo == null; // merge ancestors/descendants const relatives = [...(cpfpInfo.ancestors || []), ...(cpfpInfo.descendants || [])]; if (cpfpInfo.bestDescendant && !cpfpInfo.descendants?.length) { @@ -688,7 +689,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { } if (cpfpInfo.acceleration) { this.tx.acceleration = cpfpInfo.acceleration; - this.setIsAccelerated(); + this.setIsAccelerated(firstCpfp); } this.cpfpInfo = cpfpInfo; @@ -700,8 +701,11 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { this.hasEffectiveFeeRate = hasRelatives || (this.tx.effectiveFeePerVsize && (Math.abs(this.tx.effectiveFeePerVsize - this.tx.feePerVsize) > 0.01)); } - setIsAccelerated() { + setIsAccelerated(initialState: boolean = false) { this.isAcceleration = (this.tx.acceleration || (this.accelerationInfo && this.pool && this.accelerationInfo.pools.some(pool => (pool === this.pool.id || pool?.['pool_unique_id'] === this.pool.id)))); + if (this.isAcceleration && initialState) { + this.showAccelerationSummary = false; + } } setFeatures(): void {