mirror of
https://github.com/mempool/mempool.git
synced 2026-08-13 12:33:11 +02:00
clean up tx details query param implementation
This commit is contained in:
parent
2841b5da6c
commit
acdec5ef45
4 changed files with 11 additions and 7 deletions
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue