Skip to content

Commit c83b8a1

Browse files
committed
feat(sofi-referral): fix redirection
1 parent 55006d8 commit c83b8a1

File tree

1 file changed

+10
-7
lines changed
  • packages/blockchain-wallet-v4-frontend/src/scenes/Refer/Sofi

1 file changed

+10
-7
lines changed
Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
import React from 'react'
2-
import { Redirect, RouteComponentProps } from 'react-router-dom'
1+
import React, { useEffect } from 'react'
2+
import { RouteComponentProps } from 'react-router-dom'
33

44
const SofiReferralComponent: React.FC<RouteComponentProps> = ({ location }) => {
5-
const searchParams = new URLSearchParams(location.search)
6-
const viewParam = searchParams.get('buy')
7-
const queryString = viewParam ? `?code=${viewParam}` : '?ref=sofi'
8-
const redirectTo = `https://blockchainwallet.page.link/buysofi${queryString}`
5+
useEffect(() => {
6+
const searchParams = new URLSearchParams(location.search)
7+
const viewParam = searchParams.get('buy')
8+
const queryString = viewParam ? `?code=${viewParam}` : '?ref=sofi'
99

10-
return <Redirect to={redirectTo} />
10+
window.location.href = `https://blockchainwallet.page.link/buysofi${queryString}`
11+
}, [location])
12+
13+
return null
1114
}
1215

1316
export default SofiReferralComponent

0 commit comments

Comments
 (0)