From f6000a9883f04b365c7a6cc6252c69284808fecf Mon Sep 17 00:00:00 2001 From: enesozturk Date: Wed, 11 Dec 2024 15:39:58 +0300 Subject: [PATCH] fix: phantom deeplink url encoding --- .../solana/src/utils/handleMobileWalletRedirection.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/adapters/solana/src/utils/handleMobileWalletRedirection.ts b/packages/adapters/solana/src/utils/handleMobileWalletRedirection.ts index fc982c7bc5..a839c8917a 100644 --- a/packages/adapters/solana/src/utils/handleMobileWalletRedirection.ts +++ b/packages/adapters/solana/src/utils/handleMobileWalletRedirection.ts @@ -3,7 +3,7 @@ export function handleMobileWalletRedirection(properties: { platform: string }): void { if (properties?.name === 'Phantom' && !('phantom' in window)) { - const href = window.location.href + const href = encodeURIComponent(window.location.href) const protocol = href.startsWith('https') ? 'https' : 'http' const host = href.split('/')[2] const ref = `${protocol}://${host}` @@ -11,7 +11,7 @@ export function handleMobileWalletRedirection(properties: { } if (properties?.name === 'Coinbase Wallet' && !('coinbaseSolana' in window)) { - const href = window.location.href + const href = encodeURIComponent(window.location.href) window.location.href = `https://go.cb-w.com/dapp?cb_url=${href}` } }