From f75817022dd7084b6e0551883960c17c15e2fb5a Mon Sep 17 00:00:00 2001 From: Farolan Faisal Date: Sun, 10 Nov 2024 06:57:42 +0800 Subject: [PATCH] Unsubscribe from the channel when UpdatesForElement disconnects (#299) Unsubscribe from the channel by calling superclass's (SubscribingElement) disconnectedCallback. ## Why should this be added Fix repeated subscribe messages after a morph. --- javascript/elements/updates_for_element.js | 1 + 1 file changed, 1 insertion(+) diff --git a/javascript/elements/updates_for_element.js b/javascript/elements/updates_for_element.js index 08630fac..768b45e9 100644 --- a/javascript/elements/updates_for_element.js +++ b/javascript/elements/updates_for_element.js @@ -64,6 +64,7 @@ export default class UpdatesForElement extends SubscribingElement { } disconnectedCallback () { + super.disconnectedCallback() if (this.observeAppearance) { this.appearanceObserver.stop() }