Skip to content

Commit

Permalink
Unsubscribe from the channel when UpdatesForElement disconnects (#299)
Browse files Browse the repository at this point in the history
Unsubscribe from the channel by calling superclass's (SubscribingElement) disconnectedCallback.

## Why should this be added
Fix repeated subscribe messages after a morph.
  • Loading branch information
farolanf authored Nov 9, 2024
1 parent cc100da commit f758170
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions javascript/elements/updates_for_element.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export default class UpdatesForElement extends SubscribingElement {
}

disconnectedCallback () {
super.disconnectedCallback()
if (this.observeAppearance) {
this.appearanceObserver.stop()
}
Expand Down

0 comments on commit f758170

Please sign in to comment.