Git Product home page Git Product logo

Comments (6)

sammdec avatar sammdec commented on July 20, 2024 1

Ah ok yeah that makes sense! Happy to stick what the most default behaviour is in that case

from wagmi.

iduuck avatar iduuck commented on July 20, 2024

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.

sammdec avatar sammdec commented on July 20, 2024

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.

iduuck avatar iduuck commented on July 20, 2024

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.

tmm avatar tmm commented on July 20, 2024

@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.

github-actions avatar github-actions commented on July 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.