mirror of
https://github.com/zoriya/v10.git
synced 2026-08-05 05:37:21 +00:00
fix(html): add destroy guards to connectedCallback (#1284)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user