Skip to content

Commit

Permalink
fix: eip6963 connection issues (#1700)
Browse files Browse the repository at this point in the history
Co-authored-by: Sven <38101365+svenvoskamp@users.noreply.github.com>
  • Loading branch information
tomiir and svenvoskamp committed Jan 4, 2024
1 parent d9bc336 commit 5b6b17e
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

3 comments on commit 5b6b17e

@vercel
Copy link

@vercel vercel bot commented on 5b6b17e Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 5b6b17e Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 5b6b17e Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.