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

useWallet() hook does not update connected state on manual wallet disconnection via extension #448

Open
SergeyYuhimovich opened this issue Nov 13, 2024 · 0 comments

Comments

@SergeyYuhimovich
Copy link

Summary

When a user disconnects their wallet directly through the wallet extension (e.g., by manually disconnecting within the wallet’s interface), the useWallet() hook from does not update the connected state to reflect this change. As a result, it is not possible to detect that the wallet has been disconnected from the extension, which prevents the application from responding appropriately.

Steps to Reproduce

  1. Integrate @aptos-labs/wallet-adapter-react in a React project.
  2. Use the useWallet() hook to monitor connected state and handle wallet connection status.
  3. Connect a wallet through the extension.
  4. Manually disconnect the wallet via the wallet extension interface.
  5. Observe that the connected state in useWallet() does not change to false after the wallet is disconnected.

Expected Behavior

The connected state should update to false when the wallet is disconnected manually through the extension interface. This would allow applications to handle disconnection events correctly and provide a consistent user experience.

Actual Behavior

The connected state remains true, even after the wallet has been manually disconnected through the extension. This causes issues in applications that rely on the connected status to manage authenticated sessions or UI updates.

Additional Information

Library Version: 3.7.3
React Version: 18.3.1
Browser: Arc
Wallet Extensions: Razor Wallet, Petra Aptos Wallet

Possible Solution or Suggestion

It would be helpful if the useWallet() hook could listen to wallet connection status changes directly from the extension to accurately reflect the connection status in the connected state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant