diff --git a/frontend/src/app/components/transaction/transaction.component.html b/frontend/src/app/components/transaction/transaction.component.html index 94e28eae4..8358bc167 100644 --- a/frontend/src/app/components/transaction/transaction.component.html +++ b/frontend/src/app/components/transaction/transaction.component.html @@ -180,7 +180,7 @@
- +
diff --git a/frontend/src/app/components/transaction/transaction.component.ts b/frontend/src/app/components/transaction/transaction.component.ts index dd4bea675..78f07140c 100644 --- a/frontend/src/app/components/transaction/transaction.component.ts +++ b/frontend/src/app/components/transaction/transaction.component.ts @@ -178,9 +178,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { set txListSetter(component: TransactionsListComponent | undefined) { if (component) { this.txList = component; - if (this.isDetailsOpen) { - this.txList.toggleDetails(); - } + this.txList.setDetailsOpen(this.isDetailsOpen); } } @@ -227,6 +225,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { const urlParams = new URLSearchParams(window.location.search); this.forceAccelerationSummary = !!urlParams.get('cash_request_id'); + // Accelerator referral code const fragmentsParams = new URLSearchParams(window.location.hash.slice(1)); this.referralCode = fragmentsParams.get('referralCode') ?? this.storageService.getValue('referralCode') ?? undefined; if (this.referralCode) { @@ -875,11 +874,11 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { this.setGraphSize(); } - toggleDetailsFromTxPage(): void { + toggleDetails(): void { this.isDetailsOpen = !this.isDetailsOpen; this.router.navigate([], { relativeTo: this.route, - queryParams: { showDetails: this.isDetailsOpen ? 'true' : 'false' }, + queryParams: { showDetails: this.isDetailsOpen ? 'true' : null }, queryParamsHandling: 'merge', preserveFragment: true, replaceUrl: true, diff --git a/frontend/src/app/components/transactions-list/transactions-list.component.ts b/frontend/src/app/components/transactions-list/transactions-list.component.ts index 1a0d4b729..4229ae7be 100644 --- a/frontend/src/app/components/transactions-list/transactions-list.component.ts +++ b/frontend/src/app/components/transactions-list/transactions-list.component.ts @@ -514,6 +514,12 @@ export class TransactionsListComponent implements OnInit, OnChanges, OnDestroy { return Math.pow(base, exponent); } + setDetailsOpen(open: boolean): void { + if (open !== this.showDetails$.value) { + this.toggleDetails(); + } + } + toggleDetails(): void { if (this.showDetails$.value === true) { this.showDetails$.next(false); diff --git a/frontend/src/app/services/state.service.ts b/frontend/src/app/services/state.service.ts index 89cc9d751..592825fdc 100644 --- a/frontend/src/app/services/state.service.ts +++ b/frontend/src/app/services/state.service.ts @@ -369,7 +369,6 @@ export class StateService { } }); - const savedAuditPreference = this.storageService.getValue('audit-preference'); this.hideAudit = new BehaviorSubject(savedAuditPreference === 'hide'); this.hideAudit.subscribe((hide) => {