Comments (6)
Ah ok yeah that makes sense! Happy to stick what the most default behaviour is in that case
from wagmi.
Seems like a this is a duplicate of #35 (as you noticed yourself in the "Edit").
For the solution: It normally should not prompt every time to connect again through MetaMask, since the connecting only needs to be established once. Could be an option in MetaMask? For me it is only asking once.
from wagmi.
I would expect though that if I call disconnect after reloading it should ask me to connect again and not assume I want to automatically connect with the last used account
from wagmi.
I thought it would work with autoConnect? This is a little misleading for you I think.
Having disconnected programatically is like visiting the page, without having connected in the first place. So, if the Provider sees autoConnect
it will automatically search for the shim that was injected by Metamask, and try to connect.
If you want the desired behavior, you might want to implement ur own local storage, which is checking whether the user disconnected once in it's lifetime and set the autoConnect prop based on this local storage.
from wagmi.
@sammdec MM (and other injected providers) don't support programmatically disconnecting.
I agree it's confusing to reconnect on page reload, but technically it's the most accurate since the account is still connected to the browser. (wagmi does handle disconnect events coming from connector directly. For example, disconnecting in MM UI.)
That said, you could manage connection status separately in the browser, but you would need to listen and handle different connection events (i.e. disconnecting or switching account directly through MM extensions).
from wagmi.
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.
from wagmi.
Related Issues (20)
- Uncaught Error: Cannot find module '@tanstack/query-core' HOT 2
- Closing / clicking outside of MetaMask modal doesn't throw an error HOT 1
- type inference is not working with @wagmi/cli:2.0.4 wagmi generate HOT 5
- Inconsistent address strings HOT 2
- getContract type issue after wagmi/core 2.6.1 update HOT 2
- Documentation for 0.12.x is not available HOT 2
- Cache storage key needs versioning
- Bug: next.js dev with --turbo flag, error: No QueryClient set, use QueryClientProvider to set one HOT 4
- blockNumber is not working properly for useReadContracts hook HOT 2
- Injected Provider: using okxwallet or okexwallet can't connect with OKX wallet HOT 2
- useBlock hook returns incorrect timestamp for block HOT 6
- Multiple Issues with Injected Connectors HOT 11
- Build error from publicProvider() on nextjs HOT 2
- Connector not connected error when passing Viem account from private key HOT 4
- Typescript compile error after upgrading from v1 to v2 HOT 3
- By default, `watchAccount` invokes when the `connector` instance changes (which is what is happening here). You can scope the behaviour to only change on `address` changes by doing: HOT 1
- MetaMaskConnector not install but ready field is true HOT 3
- The writeContractAsync function does not work when called a second time HOT 1
- writeContract and useReadContract method reports error "Type error: Expected 0 arguments, but got 1." writeContract HOT 2
- In Vite, importing @wagmi/connectors triggers a warning. βModule "buffer" has been externalized for browser compatibility. Cannot access "buffer.Buffer" in client code.β HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wagmi.