Skip to content

fix: cleanup store subscription in bc-button#360

Draft
divyansh-v15-06 wants to merge 1 commit into
getAlby:masterfrom
divyansh-v15-06:fix/bc-button-unsubscribe
Draft

fix: cleanup store subscription in bc-button#360
divyansh-v15-06 wants to merge 1 commit into
getAlby:masterfrom
divyansh-v15-06:fix/bc-button-unsubscribe

Conversation

@divyansh-v15-06
Copy link
Copy Markdown

This PR fixes a potential memory leak in by properly handling
the unsubscribe function returned by store.subscribe.

Changes:

  • Store and clean up the subscription in disconnectedCallback
  • Simplify _showBalance state handling
  • Keep component behavior unchanged

This ensures subscriptions are released when the component is removed
from the DOM and prevents duplicate updates in long-running sessions.

@rolznz
Copy link
Copy Markdown
Member

rolznz commented Feb 5, 2026

Hi @I-lost-everytime sorry for the late review. Your PR has also many unrelated changes. It would be easier to review if it only does what is stated in the PR title.

@rolznz rolznz marked this pull request as draft February 5, 2026 15:32
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