mirror of
https://github.com/mempool/mempool.git
synced 2026-08-13 12:33:11 +02:00
[refactor] use fragment instead of url param for better privacy
This commit is contained in:
parent
6f7ef88372
commit
8be2ccd2d6
2 changed files with 5 additions and 5 deletions
|
|
@ -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 === '';
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue