From a66c9d0bc478111da59a089b4131816bd81a2ee8 Mon Sep 17 00:00:00 2001
From: dan <dan.abramov@gmail.com>
Date: Tue, 16 Apr 2024 21:28:39 +0100
Subject: Always send ref_ params (#3582)

---
 src/lib/statsig/statsig.tsx | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'src/lib/statsig/statsig.tsx')

diff --git a/src/lib/statsig/statsig.tsx b/src/lib/statsig/statsig.tsx
index 3d2dc1309..6fa476cd0 100644
--- a/src/lib/statsig/statsig.tsx
+++ b/src/lib/statsig/statsig.tsx
@@ -15,12 +15,12 @@ import {useSession} from '../../state/session'
 import {LogEvents} from './events'
 import {Gate} from './gates'
 
-let refSrc: string | undefined
-let refUrl: string | undefined
+let refSrc: string
+let refUrl: string
 if (isWeb && typeof window !== 'undefined') {
   const params = new URLSearchParams(window.location.search)
-  refSrc = params.get('ref_src') ?? undefined
-  refUrl = params.get('ref_url') ?? undefined
+  refSrc = params.get('ref_src') ?? ''
+  refUrl = decodeURIComponent(params.get('ref_url') ?? '')
 }
 
 export type {LogEvents}
-- 
cgit 1.4.1

