From c5fc47683470d6b194df22e1d44a00ab6f46bd2f Mon Sep 17 00:00:00 2001 From: Mononaut Date: Sat, 29 Jun 2024 09:21:39 +0000 Subject: [PATCH] [accelerator] no autoscroll to checkout --- .../accelerate-checkout.component.ts | 28 ------------------- .../components/tracker/tracker.component.html | 2 +- .../transaction/transaction.component.html | 2 +- 3 files changed, 2 insertions(+), 30 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 6c37663d0..30ce7a606 100644 --- a/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts +++ b/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts @@ -52,7 +52,6 @@ export class AccelerateCheckout implements OnInit, OnDestroy { @Input() tx: Transaction; @Input() miningStats: MiningStats; @Input() eta: ETA; - @Input() scrollEvent: boolean; @Input() cashappEnabled: boolean = true; @Input() advancedEnabled: boolean = false; @Input() forceMobile: boolean = false; @@ -139,12 +138,6 @@ export class AccelerateCheckout implements OnInit, OnDestroy { } } - ngOnChanges(changes: SimpleChanges): void { - if (changes.scrollEvent) { - this.scrollToElement('acceleratePreviewAnchor', 'start'); - } - } - moveToStep(step: CheckoutStep) { this._step = step; if (!this.estimate && ['quote', 'summary', 'checkout'].includes(this.step)) { @@ -160,26 +153,6 @@ export class AccelerateCheckout implements OnInit, OnDestroy { } } - /** - * Scroll to element id with or without setTimeout - */ - scrollToElementWithTimeout(id: string, position: ScrollLogicalPosition, timeout: number = 1000): void { - setTimeout(() => { - this.scrollToElement(id, position); - }, timeout); - } - scrollToElement(id: string, position: ScrollLogicalPosition) { - const acceleratePreviewAnchor = document.getElementById(id); - if (acceleratePreviewAnchor) { - this.cd.markForCheck(); - acceleratePreviewAnchor.scrollIntoView({ - behavior: 'smooth', - inline: position, - block: position, - }); - } - } - /** * Accelerator */ @@ -437,7 +410,6 @@ export class AccelerateCheckout implements OnInit, OnDestroy { next: (response) => { this.invoice = response; this.cd.markForCheck(); - this.scrollToElementWithTimeout('acceleratePreviewAnchor', 'start', 500); }, error: (response) => { console.log(response); diff --git a/frontend/src/app/components/tracker/tracker.component.html b/frontend/src/app/components/tracker/tracker.component.html index 5199897fc..417038539 100644 --- a/frontend/src/app/components/tracker/tracker.component.html +++ b/frontend/src/app/components/tracker/tracker.component.html @@ -122,7 +122,7 @@   } @else if (showAccelerationSummary && !accelerationFlowCompleted) { - + } @else { @if (tx?.acceleration && !tx.status?.confirmed) { diff --git a/frontend/src/app/components/transaction/transaction.component.html b/frontend/src/app/components/transaction/transaction.component.html index 58322a72d..1c83bba40 100644 --- a/frontend/src/app/components/transaction/transaction.component.html +++ b/frontend/src/app/components/transaction/transaction.component.html @@ -84,7 +84,7 @@
- + Urgent transaction? Get it confirmed faster.