From c721763b2bb805905a7e425574d0f33bb0110da3 Mon Sep 17 00:00:00 2001 From: michael1011 Date: Tue, 31 Dec 2024 15:06:23 +0100 Subject: [PATCH] fix: no ref URL param on pro site (#782) --- src/context/Global.tsx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/context/Global.tsx b/src/context/Global.tsx index 9d18a817..8cd69f5f 100644 --- a/src/context/Global.tsx +++ b/src/context/Global.tsx @@ -30,6 +30,8 @@ import { getUrlParam, isEmbed } from "../utils/urlParams"; import { checkWasmSupported } from "../utils/wasmSupport"; import { detectWebLNProvider } from "../utils/webln"; +const proReferral = "pro"; + export type GlobalContextType = { online: Accessor; setOnline: Setter; @@ -100,7 +102,7 @@ export type GlobalContextType = { const defaultReferral = () => { if (config.isPro) { - return "pro"; + return proReferral; } return isMobile() ? "boltz_webapp_mobile" : "boltz_webapp_desktop"; @@ -311,10 +313,14 @@ const GlobalProvider = (props: { children: JSX.Element }) => { void detectWebLNProvider().then((state: boolean) => setWebln(state)); setWasmSupported(checkWasmSupported()); - // check referral - const refParam = getUrlParam("ref"); - if (refParam && refParam !== "") { - setRef(refParam); + if (!config.isPro) { + // Get the referral from the URL parameters if this is not pro + const refParam = getUrlParam("ref"); + if (refParam && refParam !== "") { + setRef(refParam); + } + } else { + setRef(proReferral); } if (isEmbed()) {