Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: no ref URL param on pro site #782

Merged
merged 1 commit into from
Dec 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading