fixing moving observable in DOM
This commit is contained in:
@@ -37,7 +37,9 @@ export class UmbContextConsumer<HostType extends EventTarget = EventTarget, T =
|
||||
|
||||
protected _onResponse = (instance: T) => {
|
||||
// TODO: check that this check is not giving us any problems:
|
||||
if (this._instance === instance) return;
|
||||
if (this._instance === instance) {
|
||||
return;
|
||||
}
|
||||
this._instance = instance;
|
||||
this._callback?.(instance);
|
||||
this._promiseResolver?.(instance);
|
||||
|
||||
@@ -12,7 +12,8 @@ export class UmbObserver<T> {
|
||||
// Notice controller class implements empty hostConnected().
|
||||
|
||||
hostDisconnected() {
|
||||
this.#subscription.unsubscribe();
|
||||
// No cause then it cant re-connect, if the same element just was moved in DOM.
|
||||
//this.#subscription.unsubscribe();
|
||||
}
|
||||
|
||||
destroy(): void {
|
||||
|
||||
@@ -21,6 +21,10 @@ export class UmbWorkspaceSplitViewManager {
|
||||
|
||||
constructor(host: UmbControllerHostInterface) {
|
||||
this.#host = host;
|
||||
|
||||
this.activeVariantsInfo.subscribe((data) => {
|
||||
console.log('— activeVariantsInfo 1 updated: ', data);
|
||||
});
|
||||
}
|
||||
|
||||
private _routeBase?: string;
|
||||
|
||||
Reference in New Issue
Block a user