wallet connection fixes
This commit is contained in:
@@ -140,17 +140,17 @@ const errorHandlingProxy = {
|
|||||||
|
|
||||||
export async function connectWallet(chainId) {
|
export async function connectWallet(chainId) {
|
||||||
console.log('connectWallet', chainId)
|
console.log('connectWallet', chainId)
|
||||||
await switchChain(chainId)
|
try {
|
||||||
if (provider!==null) {
|
await switchChain(chainId)
|
||||||
try {
|
console.log('getSigner')
|
||||||
console.log('getSigner')
|
const p = new BrowserProvider(window.ethereum, chainId)
|
||||||
const p = new BrowserProvider(window.ethereum, chainId)
|
await p.getSigner()
|
||||||
await p.getSigner()
|
await updateAccounts(chainId, p)
|
||||||
await updateAccounts(chainId, p)
|
}
|
||||||
}
|
catch (e) {
|
||||||
catch (e) {
|
if (e.reason!=='rejected') {
|
||||||
if (e.reason!=='rejected')
|
console.error(e, e.reason)
|
||||||
console.error(e, e.reason)
|
throw e
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user