Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: ignore metamask pending connection error #442

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions packages/lib/shared/utils/query-errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,19 @@ export function shouldIgnore(message: string, stackTrace = ''): boolean {
return true
}

/*
Error thrown from Metamask when:
1. The extension popup is ignored by the user
2. They close the RainbowKit "Connect a wallet" modal
3. They click "Connect wallet" and chose "Metamask" a second time

As the extension modal was still opened in the background, MM will throw this error, that can be safely ignored as the Rainbowkit modal clearly states:
"Confirm connection in the extension"
*/
if (message.includes(`Request of type 'wallet_requestPermissions' already pending for origin`)) {
return true
}

return false
}

Expand Down
Loading