[accelerator] no autoscroll to checkout
This commit is contained in:
parent
776404dbde
commit
c5fc476834
@ -52,7 +52,6 @@ export class AccelerateCheckout implements OnInit, OnDestroy {
|
|||||||
@Input() tx: Transaction;
|
@Input() tx: Transaction;
|
||||||
@Input() miningStats: MiningStats;
|
@Input() miningStats: MiningStats;
|
||||||
@Input() eta: ETA;
|
@Input() eta: ETA;
|
||||||
@Input() scrollEvent: boolean;
|
|
||||||
@Input() cashappEnabled: boolean = true;
|
@Input() cashappEnabled: boolean = true;
|
||||||
@Input() advancedEnabled: boolean = false;
|
@Input() advancedEnabled: boolean = false;
|
||||||
@Input() forceMobile: 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) {
|
moveToStep(step: CheckoutStep) {
|
||||||
this._step = step;
|
this._step = step;
|
||||||
if (!this.estimate && ['quote', 'summary', 'checkout'].includes(this.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
|
* Accelerator
|
||||||
*/
|
*/
|
||||||
@ -437,7 +410,6 @@ export class AccelerateCheckout implements OnInit, OnDestroy {
|
|||||||
next: (response) => {
|
next: (response) => {
|
||||||
this.invoice = response;
|
this.invoice = response;
|
||||||
this.cd.markForCheck();
|
this.cd.markForCheck();
|
||||||
this.scrollToElementWithTimeout('acceleratePreviewAnchor', 'start', 500);
|
|
||||||
},
|
},
|
||||||
error: (response) => {
|
error: (response) => {
|
||||||
console.log(response);
|
console.log(response);
|
||||||
|
@ -122,7 +122,7 @@
|
|||||||
<span class="explainer"> </span>
|
<span class="explainer"> </span>
|
||||||
} @else if (showAccelerationSummary && !accelerationFlowCompleted) {
|
} @else if (showAccelerationSummary && !accelerationFlowCompleted) {
|
||||||
<ng-container *ngIf="(ETA$ | async) as eta;">
|
<ng-container *ngIf="(ETA$ | async) as eta;">
|
||||||
<app-accelerate-checkout *ngIf="(da$ | async) as da;" [cashappEnabled]="accelerationEligible" [advancedEnabled]="false" [forceMobile]="true" [tx]="tx" [miningStats]="miningStats" [eta]="eta" [scrollEvent]="scrollIntoAccelPreview" class="h-100 w-100"></app-accelerate-checkout>
|
<app-accelerate-checkout *ngIf="(da$ | async) as da;" [cashappEnabled]="accelerationEligible" [advancedEnabled]="false" [forceMobile]="true" [tx]="tx" [miningStats]="miningStats" [eta]="eta" class="h-100 w-100"></app-accelerate-checkout>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
} @else {
|
} @else {
|
||||||
@if (tx?.acceleration && !tx.status?.confirmed) {
|
@if (tx?.acceleration && !tx.status?.confirmed) {
|
||||||
|
@ -84,7 +84,7 @@
|
|||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
|
|
||||||
<ng-container *ngIf="(ETA$ | async) as eta;">
|
<ng-container *ngIf="(ETA$ | async) as eta;">
|
||||||
<app-accelerate-checkout *ngIf="(da$ | async) as da;" [cashappEnabled]="accelerationEligible" [advancedEnabled]="true" [tx]="tx" [eta]="eta" [miningStats]="miningStats" [scrollEvent]="scrollIntoAccelPreview" class="h-100 w-100">
|
<app-accelerate-checkout *ngIf="(da$ | async) as da;" [cashappEnabled]="accelerationEligible" [advancedEnabled]="true" [tx]="tx" [eta]="eta" [miningStats]="miningStats" class="h-100 w-100">
|
||||||
<span slot="cta-title">Urgent transaction? Get it confirmed faster.</span>
|
<span slot="cta-title">Urgent transaction? Get it confirmed faster.</span>
|
||||||
</app-accelerate-checkout>
|
</app-accelerate-checkout>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user