reown-com / reown-docs

https://docs.reown.com
MIT License
32 stars 31 forks source link

Disconnect is not expose in Modal for Vanilla JS #60

Open SerhiiKirik opened 1 month ago

SerhiiKirik commented 1 month ago

Describe the bug

There seems to be an error in the documentation in the Actions section for JavaScript (wagmi). Link: DOC

Specifically in the Disconnect section:

modal.disconnect()

The issue is that modal does not have a disconnect method. Previously, disconnect was implemented using wagmi as follows:

import { disconnect } from '@wagmi/core';

I might be mistaken, and I would be happy to hear your response. Thank you!

SerhiiKirik commented 1 month ago

Additional Comment:

I found the ConnectionController which contains a disconnect method. Therefore, we can do something like this:

await ConnectionController.disconnect();

Would this be the correct approach? Or is there a better way to handle the disconnect?

Also, the documentation lacks methods for tracking connection status, loading states, and the account. It would be helpful to add these.

rtomas commented 1 month ago

Error already know an reported . thanks https://linear.app/reown/issue/APKT-1045/[bug]-disconnect-is-not-expose

rtomas commented 1 month ago

meanwhile you can use modal.adapter?.connectionControllerClient?.disconnect()