Skip to content

Commit

Permalink
fix: metadata handling for empty URL (#4458)
Browse files Browse the repository at this point in the history
  • Loading branch information
EdouardBougon authored Dec 12, 2024
1 parent 827e470 commit 987404f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/nasty-planets-play.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wagmi/connectors": patch
---

Fixed MetaMask internal metadata handling.
13 changes: 8 additions & 5 deletions packages/connectors/src/metaMask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,15 @@ export function metaMask(parameters: MetaMaskParameters = {}) {
readonlyRPCMap,
dappMetadata: {
...parameters.dappMetadata,
name: parameters.dappMetadata?.name ?? 'wagmi',
url:
parameters.dappMetadata?.url ??
(typeof window !== 'undefined'
// Test if name and url are set AND not empty
name: parameters.dappMetadata?.name
? parameters.dappMetadata?.name
: 'wagmi',
url: parameters.dappMetadata?.url
? parameters.dappMetadata?.url
: typeof window !== 'undefined'
? window.location.origin
: 'https://wagmi.sh'),
: 'https://wagmi.sh',
},
useDeeplink: parameters.useDeeplink ?? true,
})
Expand Down

0 comments on commit 987404f

Please sign in to comment.