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

[issue] InjectedConnector always opens the injected (MetaMask) prompt #35

Closed
1 task done
marvinkennis opened this issue Jan 5, 2022 · 3 comments
Closed
1 task done

Comments

@marvinkennis
Copy link

marvinkennis commented Jan 5, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Package Version

1.0.0

Current Behavior

Whenever an Injected connector is initiated and found, the connection prompt (in my case MetaMask) is always initiated, asking me which MetaMask account I want to connect with. From a UX perspective, it would be nicer to wait until the user clicks one of the wallet buttons to trigger this. I've essentially copied the code from the example docs.

Expected Behavior

Wait for the connection to be initiated by the user, or have an option to toggle this off. I checked the source, seems like getAccounts() is called when an InjectedConnector is initiated, which in turn triggers a window.ethereum.requestAccounts() call.

Steps To Reproduce

No response

Anything else?

No response

@iduuck
Copy link

iduuck commented Jan 5, 2022

This sounds like you are using the autoConnect option of the Provider component? Can you confirm? If not, could you please create a small reproduction (i.e. CodePen)?

@marvinkennis
Copy link
Author

Absolutely correct, apologies for missing that. All good now.

Copy link
Contributor

This issue has been locked since it has been closed for more than 14 days.

If you found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest wagmi version. If you have any other comments you can create a new discussion.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants