[refactor] use fragment instead of url param for better privacy

This commit is contained in:
nymkappa 2026-01-19 23:26:54 +01:00
parent 6f7ef88372
commit 8be2ccd2d6
No known key found for this signature in database
GPG key ID: A7895A957BA87DBA
2 changed files with 5 additions and 5 deletions

View file

@ -32,7 +32,6 @@ import { TrackerStage } from '@components/tracker/tracker-bar.component';
import { MiningService, MiningStats } from '@app/services/mining.service';
import { ETA, EtaService } from '@app/services/eta.service';
import { getTransactionFlags, getUnacceleratedFeeRate } from '@app/shared/transaction.utils';
import { RelativeUrlPipe } from '@app/shared/pipes/relative-url/relative-url.pipe';
import { StorageService } from '@app/services/storage.service';
@ -156,9 +155,9 @@ export class TrackerComponent implements OnInit, OnDestroy {
ngOnInit() {
this.onResize();
// Accelerator referral code
const urlParams = new URLSearchParams(window.location.search);
this.referralCode = urlParams.get('referralCode') ?? this.storageService.getValue('referralCode') ?? undefined;
// Accelerator referral code in fragment
const fragmentsParams = new URLSearchParams(window.location.hash);
this.referralCode = fragmentsParams.get('referralCode') ?? this.storageService.getValue('referralCode') ?? undefined;
this.storageService.setValue('referralCode', this.referralCode);
this.acceleratorAvailable = this.stateService.env.OFFICIAL_MEMPOOL_SPACE && this.stateService.env.ACCELERATOR && this.stateService.network === '';

View file

@ -211,7 +211,8 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
this.forceAccelerationSummary = !!urlParams.get('cash_request_id');
// Accelerator referral code
this.referralCode = urlParams.get('referralCode') ?? this.storageService.getValue('referralCode') ?? undefined;
const fragmentsParams = new URLSearchParams(window.location.hash);
this.referralCode = fragmentsParams.get('referralCode') ?? this.storageService.getValue('referralCode') ?? undefined;
this.storageService.setValue('referralCode', this.referralCode);
this.hideAccelerationSummary = this.stateService.isMempoolSpaceBuild ? this.storageService.getValue('hide-accelerator-pref') == 'true' : true;