clean up tx details query param implementation

This commit is contained in:
Mononaut 2026-02-19 07:11:02 +00:00
parent 2841b5da6c
commit acdec5ef45
No known key found for this signature in database
GPG key ID: A3F058E41374C04E
4 changed files with 11 additions and 7 deletions

View file

@ -180,7 +180,7 @@
<div class="title-buttons">
<button *ngIf="!flowEnabled" type="button" class="btn btn-outline-info flow-toggle btn-sm" (click)="toggleGraph()" i18n="show-diagram">Show diagram</button>
<button type="button" class="btn btn-outline-info btn-sm" (click)="toggleDetailsFromTxPage()" i18n="transaction.details|Transaction Details">Details</button>
<button type="button" class="btn btn-outline-info btn-sm" (click)="toggleDetails()" i18n="transaction.details|Transaction Details">Details</button>
</div>
</div>

View file

@ -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,

View file

@ -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);

View file

@ -369,7 +369,6 @@ export class StateService {
}
});
const savedAuditPreference = this.storageService.getValue('audit-preference');
this.hideAudit = new BehaviorSubject<boolean>(savedAuditPreference === 'hide');
this.hideAudit.subscribe((hide) => {