diff --git a/packages/wallet/frontend/src/pages/send.tsx b/packages/wallet/frontend/src/pages/send.tsx index 45863692c..c5fb11e84 100644 --- a/packages/wallet/frontend/src/pages/send.tsx +++ b/packages/wallet/frontend/src/pages/send.tsx @@ -37,6 +37,7 @@ import { ExchangeRate } from '@/components/ExchangeRate' import { useSnapshot } from 'valtio' import { balanceState } from '@/lib/balance' import { AssetOP } from '@wallet/shared' +import { useRouter } from 'next/router' type SendProps = InferGetServerSidePropsType @@ -50,6 +51,9 @@ const SendPage: NextPageWithLayout = ({ accounts }) => { const [receiverAssetCode, setReceiverAssetCode] = useState( null ) + const router = useRouter() + const receiverFromQueryParams = router.query?.receiver ? decodeURIComponent(router.query?.receiver as string) : null; + const [receiverPublicName, setReceiverPublicName] = useState('Recepient') const [currentExchangeRates, setCurrentExchangeRates] = useState() @@ -80,7 +84,7 @@ const SendPage: NextPageWithLayout = ({ accounts }) => { schema: sendSchema, defaultValues: { paymentType: PAYMENT_SEND, - receiver: isUserFirstTime ? INTERLEDGER_WALLET_ADDRESS : '' + receiver: receiverFromQueryParams ?? (isUserFirstTime ? INTERLEDGER_WALLET_ADDRESS : '') } })