airgap-it / beacon-sdk

The beacon sdk allows developers of dApps and wallets on Tezos to implement the wallet interaction standard tzip-10.
https://walletbeacon.io
MIT License
103 stars 65 forks source link

Clearing active account in second tab results in unexpected behaviour #649

Closed AndreasGassmann closed 1 year ago

AndreasGassmann commented 1 year ago

Describe the bug (current behavior) A slight variation of https://github.com/airgap-it/beacon-sdk/issues/623. After clearing the active account in one tab, the change is not reflected in the other tabs.

To Reproduce Steps to reproduce the behavior:

  1. Go to the example dapp and pair with Kukai
  2. Open the example dapp in a second tab and click 'clear active account'
  3. Go back to the first tab with the example dapp and do not refresh the page
  4. Click the 'Permission request' button and then click on 'Kukai'

Expected (correct) behavior The dApp should be aware that there is no more active account

AndreasGassmann commented 1 year ago

Our proposed solution is to listen to localStorage changes surrounding the active account. If it's changed, we update all other tabs by using this.setActiveAccount(account | undefined).

AndreasGassmann commented 1 year ago

Addressed with https://github.com/airgap-it/beacon-sdk/pull/651