always provide
This commit is contained in:
@@ -47,6 +47,8 @@ export class UmbContextProvider<BaseType = unknown, ResultType extends BaseType
|
||||
this._contextAlias = idSplit[0];
|
||||
this._apiAlias = idSplit[1] ?? 'default';
|
||||
this.#instance = instance;
|
||||
|
||||
this.hostElement.addEventListener(UMB_CONTENT_REQUEST_EVENT_TYPE, this.#handleContextRequest);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -71,7 +73,7 @@ export class UmbContextProvider<BaseType = unknown, ResultType extends BaseType
|
||||
* @memberof UmbContextProvider
|
||||
*/
|
||||
public hostConnected() {
|
||||
this.hostElement.addEventListener(UMB_CONTENT_REQUEST_EVENT_TYPE, this.#handleContextRequest);
|
||||
//this.hostElement.addEventListener(UMB_CONTENT_REQUEST_EVENT_TYPE, this.#handleContextRequest);
|
||||
this.hostElement.dispatchEvent(new UmbContextProvideEventImplementation(this._contextAlias));
|
||||
|
||||
// Listen to our debug event 'umb:debug-contexts'
|
||||
@@ -82,7 +84,7 @@ export class UmbContextProvider<BaseType = unknown, ResultType extends BaseType
|
||||
* @memberof UmbContextProvider
|
||||
*/
|
||||
public hostDisconnected() {
|
||||
this.hostElement.removeEventListener(UMB_CONTENT_REQUEST_EVENT_TYPE, this.#handleContextRequest);
|
||||
//this.hostElement.removeEventListener(UMB_CONTENT_REQUEST_EVENT_TYPE, this.#handleContextRequest);
|
||||
// Out-commented for now, but kept if we like to reintroduce this:
|
||||
//window.dispatchEvent(new UmbContextUnprovidedEventImplementation(this._contextAlias, this.#instance));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user