Skip to content

Commit

Permalink
Merge pull request #2526 from umbraco/v15/feature/make-extension-slot…
Browse files Browse the repository at this point in the history
…-destroy-on-disconnect

Remove attached on destroy
  • Loading branch information
madsrasmussen authored Nov 8, 2024
2 parents 6a7e8ad + c65010a commit 44d2366
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/libs/controller-api/controller-host.mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export const UmbControllerHostMixin = <T extends ClassConstructor>(superClass: T
prev = ctrl;
}
this.#controllers.length = 0;
this.#attached = false;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ export abstract class UmbBaseExtensionInitializer<
/*
public hostConnected(): void {
super.hostConnected();
// Should not be nesecary as conditions would be reactive to connectedCallback, as they will use consumeContext. [NL]
//this.#onConditionsChangedCallback();
}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export class UmbExtensionSlotElement extends UmbLitElement {
this.#observeExtensions();
}
override disconnectedCallback(): void {
// _permitted is reset as the extensionsController fires a callback on destroy.
this.#attached = false;
this.#extensionsController?.destroy();
this.#extensionsController = undefined;
Expand Down

0 comments on commit 44d2366

Please sign in to comment.