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

Fix Brave browser off event listeners #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lubej
Copy link
Contributor

@lubej lubej commented Jan 11, 2024

Brave browser does not support off events, docs here: https://wallet-docs.brave.com/ethereum/provider-api/events/

@lubej lubej changed the title Fix Brave browser off event listener Fix Brave browser off event listeners Jan 11, 2024
@lubej lubej force-pushed the ml/fix-brave-off-event-listeners branch from abaf99e to 6fec739 Compare January 11, 2024 13:44
ethProvider.off('chainChanged', _chainChanged)
ethProvider.off('connect', _connect)
ethProvider.off('disconnect', _disconnect)
ethProvider.off?.('accountsChanged', _accountsChanged)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's safe to simply not unsubscribe. I think safe options are:

  • rewrite listeners so unsubscribing is never needed
  • implement unsubscribing inside listeners
  • reload page if can't unsubscribe

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, didn't want to spend much time on it. Since WalletConnect integration is not decided yet. We can just add Brave as a wallet in WalletConnect options.

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

Successfully merging this pull request may close these issues.

2 participants