Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Call disconnect on Solana Provider when permission revoked #7688

Closed
StephenHeaps opened this issue Jul 5, 2023 · 1 comment
Closed

Call disconnect on Solana Provider when permission revoked #7688

StephenHeaps opened this issue Jul 5, 2023 · 1 comment

Comments

@StephenHeaps
Copy link
Contributor

StephenHeaps commented Jul 5, 2023

Description:

Related to brave/brave-browser#24974.

Above PR implements a new DisconnectEvent on SolanaEventsListener which should emit the disconnect event. This event listener method will be called when Disconnect() is called on the provider. We need to implement the above new SolanaEventsListener method, and call disconnect on the provider when permissions are revoked for the site (assuming it's open & has a provider).

cc @darkdh

Test Plan

  1. Setup wallet with fresh profile.
  2. Open two tabs and navigates to different Solana DApps in each and set network to Solana Mainnet for both.
  3. Connect to both DApps
  4. Check both panels showing "Connected".
  5. Open Web3 Settings -> Solana and verify both connections shown.
  6. Revoke the entry associated with one of the two DApps opened in step 2.
  7. Switch to the tab for DApp whose permission was revoked and verify Connected is not shown.
  8. Switch to the tab for the other DApp, verify it still shows Connected.
@srirambv
Copy link
Contributor

Verification passed on iPhone 13 with iOS 17 running 1.58 (23.9.19.14)

  • Verified steps from issue description
  • Verified different dapps connected or disconnected state with Solana wallet is correctly shown in panel
7688.MP4

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

No branches or pull requests

2 participants