Skip to content

Commit 26907f2

Browse files
hotfix: context provider should not destroy instance (#18864)
* do not destroy instance * Update src/Umbraco.Web.UI.Client/src/libs/context-api/provide/context-provider.ts Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
1 parent 85176d1 commit 26907f2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Umbraco.Web.UI.Client/src/libs/context-api/provide/context-provider.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ export class UmbContextProvider<BaseType = unknown, ResultType extends BaseType
103103
// Note we are not removing the event listener in the hostDisconnected, therefor we do it here [NL].
104104
this.#eventTarget?.removeEventListener(UMB_CONTEXT_REQUEST_EVENT_TYPE, this.#handleContextRequest);
105105
this.#eventTarget?.removeEventListener(UMB_DEBUG_CONTEXT_EVENT_TYPE, this.#handleDebugContextRequest);
106-
// We want to call a destroy method on the instance, if it has one.
107-
(this.#instance as any)?.destroy?.();
106+
// We do not want to call a destroy method on the instance, because maybe it should be re-provided later on. [NL]
108107
this.#instance = undefined;
109108
(this.#eventTarget as unknown) = undefined;
110109
}

0 commit comments

Comments
 (0)