Switched to serialized version of component to component activation observers
This commit is contained in:
@@ -10,7 +10,7 @@ class DesktopManager {
|
|||||||
this.$rootScope = $rootScope;
|
this.$rootScope = $rootScope;
|
||||||
this.timeout = $timeout;
|
this.timeout = $timeout;
|
||||||
this.updateObservers = [];
|
this.updateObservers = [];
|
||||||
this.activationObservers = [];
|
this.componentActivationObservers = [];
|
||||||
|
|
||||||
this.isDesktop = isDesktopApplication();
|
this.isDesktop = isDesktopApplication();
|
||||||
|
|
||||||
@@ -110,21 +110,23 @@ class DesktopManager {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
desktop_registerActivationObserver(callback) {
|
desktop_registerComponentActivationObserver(callback) {
|
||||||
var observer = {id: Math.random, callback: callback};
|
var observer = {id: Math.random, callback: callback};
|
||||||
this.activationObservers.push(observer);
|
this.componentActivationObservers.push(observer);
|
||||||
return observer;
|
return observer;
|
||||||
}
|
}
|
||||||
|
|
||||||
desktop_deregisterActivationObserver(observer) {
|
desktop_deregisterComponentActivationObserver(observer) {
|
||||||
_.pull(this.activationObservers, observer);
|
_.pull(this.componentActivationObservers, observer);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Notify observers that a component has been registered/activated */
|
/* Notify observers that a component has been registered/activated */
|
||||||
notifyComponentActivation(component) {
|
async notifyComponentActivation(component) {
|
||||||
|
var serializedComponent = await this.convertComponentForTransmission(component);
|
||||||
|
|
||||||
this.timeout(() => {
|
this.timeout(() => {
|
||||||
for(var observer of this.activationObservers) {
|
for(var observer of this.componentActivationObservers) {
|
||||||
observer.callback(component);
|
observer.callback(serializedComponent);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user