Skip to content

Commit 760b250

Browse files
[SDK] Fix MetaMask deeplink parsing (#6963)
1 parent 669a95f commit 760b250

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.changeset/angry-hats-start.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
Fix metamask deeplink parsing

packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/DeepLinkConnectUI.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ export const DeepLinkConnectUI = (props: {
2525
onBack?: () => void;
2626
client: ThirdwebClient;
2727
}) => {
28-
const link = encodeURIComponent(window.location.toString());
28+
let link = window.location.toString();
29+
if (props.wallet.id === "io.metamask") {
30+
link = link.replace("https://", "");
31+
} else {
32+
link = encodeURIComponent(link);
33+
}
2934
const deeplink = `${props.deepLinkPrefix}${link}?ref=${link}`;
3035
return (
3136
<Container animate="fadein">

0 commit comments

Comments
 (0)