make sure to clean up
This commit is contained in:
@@ -176,6 +176,12 @@ export abstract class UmbBaseExtensionInitializer<
|
||||
configsOfThisType.map((conditionConfig) => this.#createConditionController(conditionManifest, conditionConfig)),
|
||||
);
|
||||
|
||||
// If we got destroyed in the mean time, then we don't need to continue:
|
||||
if (!this.#extensionRegistry) {
|
||||
newConditionControllers.forEach((controller) => controller?.destroy());
|
||||
return;
|
||||
}
|
||||
|
||||
const oldLength = this.#conditionControllers.length;
|
||||
|
||||
newConditionControllers
|
||||
|
||||
@@ -153,6 +153,7 @@ export class UmbExtensionWithApiSlotElement extends UmbLitElement {
|
||||
}
|
||||
|
||||
#observeExtensions(): void {
|
||||
// We want to be attached before we start observing extensions, cause first at this point we know that we got the right properties. [NL]
|
||||
if (!this.#attached) return;
|
||||
this.#extensionsController?.destroy();
|
||||
if (this.#type) {
|
||||
|
||||
Reference in New Issue
Block a user