fix(html): add destroy guards to connectedCallback (#1284)

This commit is contained in:
rahim
2026-04-08 17:43:16 +10:00
committed by GitHub
parent 0dc7567e7a
commit 53fffe8e30
4 changed files with 4 additions and 0 deletions
@@ -40,6 +40,7 @@ export class AlertDialogElement extends MediaElement {
override connectedCallback(): void {
super.connectedCallback();
if (this.destroyed) return;
this.#dialog = createAlertDialog({
transition: createTransition(),
@@ -22,6 +22,7 @@ export class BufferingIndicatorElement extends MediaElement {
override connectedCallback(): void {
super.connectedCallback();
if (this.destroyed) return;
this.#disconnect = new AbortController();
@@ -41,6 +41,7 @@ export class ErrorDialogElement extends MediaElement {
override connectedCallback(): void {
super.connectedCallback();
if (this.destroyed) return;
this.#dialog = createAlertDialog({
transition: createTransition(),
@@ -41,6 +41,7 @@ export abstract class MediaButtonElement<Core extends MediaButtonComponent> exte
override connectedCallback(): void {
super.connectedCallback();
if (this.destroyed) return;
if (this.hotkeyAction && !this.#hotkeyRegistry) {
this.#hotkeyRegistry = new AriaKeyShortcutsController(this, this.hotkeyAction);