Skip to content

Commit

Permalink
Merge branch 'V3' into fix/ethers-loading-hanging
Browse files Browse the repository at this point in the history
  • Loading branch information
svenvoskamp authored Jan 4, 2024
2 parents b078527 + 5b6b17e commit f40b0f8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/wagmi/src/connectors/EIP6963Connector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,16 @@ export class EIP6963Connector extends InjectedConnector {
public override async isAuthorized(eip6963Wallet?: EIP6963Wallet) {
const connectedEIP6963Rdns = this.storage?.getItem(connectedRdnsKey)
if (connectedEIP6963Rdns) {
if (!eip6963Wallet || connectedEIP6963Rdns !== eip6963Wallet.info.rdns) {
return true
if (this.#eip6963Wallet && connectedEIP6963Rdns === this.#eip6963Wallet.info.rdns) {
const provider = this.#eip6963Wallet.provider
const accounts = await provider.request({ method: 'eth_accounts' })
if (accounts.length) {
return true
}
}
if (eip6963Wallet) {
this.#eip6963Wallet = eip6963Wallet
}
this.#eip6963Wallet = eip6963Wallet
}

return super.isAuthorized()
Expand Down

0 comments on commit f40b0f8

Please sign in to comment.