File tree Expand file tree Collapse file tree
packages/wallet/frontend/src/pages Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ import { ExchangeRate } from '@/components/ExchangeRate'
3737import { useSnapshot } from 'valtio'
3838import { balanceState } from '@/lib/balance'
3939import { AssetOP } from '@wallet/shared'
40+ import { useRouter } from 'next/router'
4041
4142type SendProps = InferGetServerSidePropsType < typeof getServerSideProps >
4243
@@ -50,6 +51,9 @@ const SendPage: NextPageWithLayout<SendProps> = ({ accounts }) => {
5051 const [ receiverAssetCode , setReceiverAssetCode ] = useState < string | null > (
5152 null
5253 )
54+ const router = useRouter ( )
55+ const receiverFromQueryParams = router . query ?. receiver ? decodeURIComponent ( router . query . receiver as string ) : null ;
56+
5357 const [ receiverPublicName , setReceiverPublicName ] = useState ( 'Recepient' )
5458 const [ currentExchangeRates , setCurrentExchangeRates ] =
5559 useState < ExchangeRates > ( )
@@ -80,7 +84,7 @@ const SendPage: NextPageWithLayout<SendProps> = ({ accounts }) => {
8084 schema : sendSchema ,
8185 defaultValues : {
8286 paymentType : PAYMENT_SEND ,
83- receiver : isUserFirstTime ? INTERLEDGER_WALLET_ADDRESS : ''
87+ receiver : receiverFromQueryParams ?? ( isUserFirstTime ? INTERLEDGER_WALLET_ADDRESS : '' )
8488 }
8589 } )
8690
You can’t perform that action at this time.
0 commit comments