Skip to content
This repository has been archived by the owner on Sep 6, 2023. It is now read-only.

Commit

Permalink
fix(connectors): MetaMask resource unavailable (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm authored Mar 21, 2023
1 parent 6db42f1 commit 11f3fe2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/healthy-coins-beg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@wagmi/connectors': patch
---

Fixed issue where `UNSTABLE_shimOnConnectSelectAccount` would not bubble up error for MetaMask if request to connect was already active.
6 changes: 6 additions & 0 deletions packages/connectors/src/metaMask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ export class MetaMaskConnector extends InjectedConnector {
// Only bubble up error if user rejects request
if (this.isUserRejectedRequestError(error))
throw new UserRejectedRequestError(error)
// Or MetaMask is already open
if (
(error as ResourceUnavailableError).code ===
new ResourceUnavailableError(error).code
)
throw error
}
}

Expand Down

0 comments on commit 11f3fe2

Please sign in to comment.