Add files via upload

This commit is contained in:
Egor
2026-01-25 09:05:28 +03:00
committed by GitHub
parent 97b2fa319a
commit 13c7d23422
2 changed files with 8 additions and 10 deletions

View File

@@ -63,11 +63,10 @@ export default function Profile() {
staleTime: 60000, staleTime: 60000,
}) })
// Build referral link // Build referral link for cabinet
const botUsername = import.meta.env.VITE_TELEGRAM_BOT_USERNAME const referralLink = referralInfo?.referral_code
const referralLink = referralInfo?.referral_code && botUsername ? `${window.location.origin}/login?ref=${referralInfo.referral_code}`
? `https://t.me/${botUsername}?start=${referralInfo.referral_code}` : ''
: referralInfo?.referral_link || ''
const copyReferralLink = () => { const copyReferralLink = () => {
if (referralLink) { if (referralLink) {

View File

@@ -68,11 +68,10 @@ export default function Referral() {
queryFn: referralApi.getReferralInfo, queryFn: referralApi.getReferralInfo,
}) })
// Build referral link using frontend env variable for correct bot username // Build referral link for cabinet registration
const botUsername = import.meta.env.VITE_TELEGRAM_BOT_USERNAME const referralLink = info?.referral_code
const referralLink = info?.referral_code && botUsername ? `${window.location.origin}/login?ref=${info.referral_code}`
? `https://t.me/${botUsername}?start=${info.referral_code}` : ''
: info?.referral_link || ''
const { data: terms } = useQuery({ const { data: terms } = useQuery({
queryKey: ['referral-terms'], queryKey: ['referral-terms'],