Merge pull request #1587 from umbraco/bugfix/remove-event-listener-on-destroy

fix: remove event listener
This commit is contained in:
Niels Lyngsø
2024-04-11 13:42:28 +02:00
committed by GitHub
2 changed files with 5 additions and 0 deletions

View File

@@ -163,6 +163,7 @@ export class UmbBlockTypeWorkspaceContext<BlockTypeData extends UmbBlockTypeWith
public destroy(): void {
this.#data.destroy();
this.#properties.destroy();
super.destroy();
}
}

View File

@@ -355,6 +355,10 @@ export abstract class UmbTreeItemContextBase<TreeItemType extends UmbTreeItemMod
UmbRequestReloadTreeItemChildrenEvent.TYPE,
this.#onReloadRequest as EventListener,
);
this.#actionEventContext?.removeEventListener(
UmbRequestReloadStructureForEntityEvent.TYPE,
this.#onReloadStructureRequest as unknown as EventListener,
);
window.removeEventListener('navigationend', this.#debouncedCheckIsActive);
super.destroy();
}