Skip to content

Commit

Permalink
SMC-4749: created fromRemotePeer function for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
southbite committed Dec 8, 2021
1 parent 37e1cf3 commit 1e7dec6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/brokerage.js
Expand Up @@ -105,8 +105,9 @@ Brokerage.prototype.__updateInjectedComponent = function(changedComponent, whatC
.then(() => {
this.__updateInjectedElements(changedComponent, updatedElement);
this.logger.info('element re-injected: ' + changedComponent.component.name);
if (whatChanged.meshName !== this.__mesh._mesh.config.name) {
if (this.__fromRemotePeer(whatChanged)) {
// pre-injected placeholders would be created by this peer itself
// and so they should be ignored for satisfaction
this.__satisfiedElementNames.push(changedComponent.component.name);
}
this.__checkDependenciesSatisfied();
Expand All @@ -116,6 +117,10 @@ Brokerage.prototype.__updateInjectedComponent = function(changedComponent, whatC
});
};

Brokerage.prototype.__fromRemotePeer = function(whatChanged) {
return whatChanged.meshName !== this.__mesh._mesh.config.name;
};

Brokerage.prototype.__updateInjectedElements = function(changedComponent, updatedElement) {
const changedComponentIndex = this.__injectedElements.indexOf(changedComponent);

Expand Down

0 comments on commit 1e7dec6

Please sign in to comment.