Skip to content

Commit

Permalink
fix: add guard to handle brave bug
Browse files Browse the repository at this point in the history
  • Loading branch information
devstein committed Mar 15, 2023
1 parent 37ea679 commit 7ec328f
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions src/connect/wallets/evm/MetaMask.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -271,17 +271,23 @@ export const isMetaMask = (

// Brave tries to make itself look like MetaMask
// Could also try RPC `web3_clientVersion` if following is unreliable
if (ethereum.isBraveWallet && !ethereum._events && !ethereum._state) {
return false;
}
try {
if (ethereum.isBraveWallet && !ethereum._events && !ethereum._state) {
return false;
}
} catch {}

if (ethereum.isTokenPocket) {
return false;
}
try {
if (ethereum.isTokenPocket) {
return false;
}
} catch {}

if (ethereum.isTokenary) {
return false;
}
try {
if (ethereum.isTokenary) {
return false;
}
} catch {}

return true;
};
Expand Down

0 comments on commit 7ec328f

Please sign in to comment.