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 18bc8672b..2d3629ef0 100644 --- a/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html +++ b/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html @@ -228,7 +228,7 @@ - + Available balance @@ -244,6 +244,17 @@ + + + + + + + + Login + + + diff --git a/frontend/src/app/components/accelerate-preview/accelerate-preview.component.ts b/frontend/src/app/components/accelerate-preview/accelerate-preview.component.ts index 1c356a80b..6bcc5e958 100644 --- a/frontend/src/app/components/accelerate-preview/accelerate-preview.component.ts +++ b/frontend/src/app/components/accelerate-preview/accelerate-preview.component.ts @@ -1,4 +1,5 @@ import { Component, OnInit, Input, OnDestroy, OnChanges, SimpleChanges, HostListener } from '@angular/core'; +import { Router } from '@angular/router'; import { ApiService } from '../../services/api.service'; import { Subscription, catchError, of, tap } from 'rxjs'; import { StorageService } from '../../services/storage.service'; @@ -62,7 +63,8 @@ export class AcceleratePreviewComponent implements OnInit, OnDestroy, OnChanges constructor( private apiService: ApiService, - private storageService: StorageService + private storageService: StorageService, + private router: Router, ) { } ngOnDestroy(): void { @@ -73,7 +75,7 @@ export class AcceleratePreviewComponent implements OnInit, OnDestroy, OnChanges ngOnChanges(changes: SimpleChanges): void { if (changes.scrollEvent) { - this.scrollToPreview('acceleratePreviewAnchor', 'center'); + this.scrollToPreview('acceleratePreviewAnchor', 'start'); } } @@ -126,7 +128,7 @@ export class AcceleratePreviewComponent implements OnInit, OnDestroy, OnChanges this.maxCost = this.userBid + this.estimate.mempoolBaseFee + this.estimate.vsizeFee; if (!this.error) { - this.scrollToPreview('acceleratePreviewAnchor', 'center'); + this.scrollToPreview('acceleratePreviewAnchor', 'start'); } } }), diff --git a/frontend/src/app/components/transaction/transaction.component.html b/frontend/src/app/components/transaction/transaction.component.html index 81bbec1aa..3c30789e2 100644 --- a/frontend/src/app/components/transaction/transaction.component.html +++ b/frontend/src/app/components/transaction/transaction.component.html @@ -83,7 +83,7 @@ -
+

Accelerate

@@ -138,7 +138,7 @@ - + Features diff --git a/frontend/src/app/components/transaction/transaction.component.ts b/frontend/src/app/components/transaction/transaction.component.ts index 505c4686d..1f6aec5e2 100644 --- a/frontend/src/app/components/transaction/transaction.component.ts +++ b/frontend/src/app/components/transaction/transaction.component.ts @@ -619,10 +619,14 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { // simulate normal anchor fragment behavior applyFragment(): void { const anchor = Array.from(this.fragmentParams.entries()).find(([frag, value]) => value === ''); - if (anchor) { - const anchorElement = document.getElementById(anchor[0]); - if (anchorElement) { - anchorElement.scrollIntoView(); + if (anchor?.length) { + if (anchor[0] === 'accelerate') { + setTimeout(this.onAccelerateClicked.bind(this), 100); + } else { + const anchorElement = document.getElementById(anchor[0]); + if (anchorElement) { + anchorElement.scrollIntoView(); + } } } }