Skip to content

Commit

Permalink
fix: no ref URL param on pro site (#782)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael1011 authored Dec 31, 2024
1 parent 0285e79 commit c721763
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/context/Global.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<boolean>;
setOnline: Setter<boolean>;
Expand Down Expand Up @@ -100,7 +102,7 @@ export type GlobalContextType = {

const defaultReferral = () => {
if (config.isPro) {
return "pro";
return proReferral;
}

return isMobile() ? "boltz_webapp_mobile" : "boltz_webapp_desktop";
Expand Down Expand Up @@ -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()) {
Expand Down

0 comments on commit c721763

Please sign in to comment.