Skip to content

Commit

Permalink
new wallet changes
Browse files Browse the repository at this point in the history
  • Loading branch information
corlard3y committed Jul 18, 2023
1 parent 292db34 commit 4505325
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/AppLogin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,19 @@ useEffect(() => {
onClick={async () => {
setActivatingConnector(currentConnector);

// await currentConnector?.activate();
try {
setAuthError(undefined);
if (currentConnector instanceof WalletConnect) {
await currentConnector.activate(chainIds.includes(parseInt(window.ethereum.networkVersion)) ? '' : desiredChain)
await currentConnector.activate(desiredChain);
} else {
await currentConnector.activate(chainIds.includes(parseInt(window.ethereum.networkVersion)) ? '' : getAddChainParameters(desiredChain));
if (window.ethereum === undefined || window.ethereum.networkVersion === undefined){
setAuthError({
message: 'Web3 not enabled, install MetaMask on desktop or visit from a dApp browser on mobile',
})
}
else{
await currentConnector.activate(chainIds.includes(parseInt(window.ethereum.networkVersion)) ? '' : getAddChainParameters(desiredChain));
}
}
}
catch(error){
Expand Down

0 comments on commit 4505325

Please sign in to comment.