Skip to content

Conversation

@ekzyis
Copy link
Member

@ekzyis ekzyis commented Oct 11, 2025

Description

Instead of using a component that only uses useEffect to hook into WebLN events from the browser extension, we can just call useEffect in a custom hook like we already do for other hooks.

Additional context

This is targeting the wallets branch instead of master, because the changes here depend on the changes in wallets that have not been merged yet into master (#2572).

I did not want to port the code back to master since it's not that important so I'd rather just not have to resolve a conflict later.

Checklist

Are your changes backward compatible? Please answer below:

yes

On a scale of 1-10 how well and how have you QA'd this change and any features it might affect? Please answer below:

8. WebLN wallet still disabled when lightning browser extension is disabled

For frontend changes: Tested on mobile, light and dark mode? Please answer below:

n/a

Did you introduce any new environment variables? If so, call them out explicitly here:

no

Did you use AI for this? If so, how much did it assist you?

no


Note

Convert the WebLnProvider component into a useWeblnEvents hook and wire it into global wallet hooks, removing the provider wrapper.

  • Wallets (client):
    • Replace WebLnProvider usage in wallets/client/hooks/global.js with useWeblnEvents() inside WalletHooks, removing the provider wrapper around children.
  • WebLN protocol:
    • Convert component WebLnProvider to hook useWeblnEvents in wallets/lib/protocols/webln.js to manage webln:enabled/disabled events and set window.weblnEnabled for isAvailable.

Written by Cursor Bugbot for commit 1614dd9. This will update automatically on new commits. Configure here.

cursor[bot]

This comment was marked as outdated.

Base automatically changed from wallets to master October 11, 2025 21:49
@ekzyis
Copy link
Member Author

ekzyis commented Oct 19, 2025

Base automatically changed from wallets to master last week

wow, this is cool, GitHub realized I wanted to merge this into #2572, but #2572 was merged into master (and the wallets branch deleted), and thus this PR now also points to master as it should

@ekzyis ekzyis force-pushed the refactor-webln branch 3 times, most recently from 28e60b0 to 9d0369f Compare October 19, 2025 11:55
@huumn huumn merged commit 0ab4861 into master Oct 20, 2025
7 checks passed
@huumn huumn deleted the refactor-webln branch October 20, 2025 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants