Skip to content

Commit

Permalink
Fix referral code issue
Browse files Browse the repository at this point in the history
  • Loading branch information
thi-investax committed Jan 16, 2025
1 parent 1045fbd commit 9b16428
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/pages/KYC/IndividualKycFormV2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { EmailType, SecondaryContactTypeV2, SuccessType } from './enum'
import SecondaryContactOption from './SecondaryContactOption'
import CountriesBlockAlert from './CountriesBlockAlert'
import useQuery from 'hooks/useQuery'
import { isValidReferralCode } from 'utils'

export const FormRow = styled(Row)`
align-items: flex-start;
Expand Down Expand Up @@ -172,6 +173,11 @@ export default function IndividualKycFormV2() {
useEffect(() => {
console.log('APP URL', window.location.href)
const code = query.get('referralCode')

if (!code || !isValidReferralCode(code)) {
return
}

const storedReferralCode = localStorage.getItem('referralCode')
if (code) {
setReferralCode(code)
Expand Down

0 comments on commit 9b16428

Please sign in to comment.