diff --git a/.changeset/angry-hats-start.md b/.changeset/angry-hats-start.md new file mode 100644 index 00000000000..bee3a4da15a --- /dev/null +++ b/.changeset/angry-hats-start.md @@ -0,0 +1,5 @@ +--- +"thirdweb": patch +--- + +Fix metamask deeplink parsing diff --git a/packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/DeepLinkConnectUI.tsx b/packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/DeepLinkConnectUI.tsx index 67e009bae04..575dfe64cf4 100644 --- a/packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/DeepLinkConnectUI.tsx +++ b/packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/DeepLinkConnectUI.tsx @@ -25,7 +25,12 @@ export const DeepLinkConnectUI = (props: { onBack?: () => void; client: ThirdwebClient; }) => { - const link = encodeURIComponent(window.location.toString()); + let link = window.location.toString(); + if (props.wallet.id === "io.metamask") { + link = link.replace("https://", ""); + } else { + link = encodeURIComponent(link); + } const deeplink = `${props.deepLinkPrefix}${link}?ref=${link}`; return (