Skip to content

Commit

Permalink
fix(plugins): ensure plugin installation can only happen once
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Dec 28, 2014
1 parent 2bf0dfc commit 9b37c84
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export class Plugins {
constructor(aurelia){
this.aurelia = aurelia;
this.info = [];
this.hasProcessed = false;
}

install(moduleId, config){
Expand All @@ -38,7 +39,13 @@ export class Plugins {
aurelia = this.aurelia,
loader = aurelia.loader,
info = this.info,
i, ii, current, result;
i, ii;

if(this.hasProcessed){
return Promise.resolve();
}

this.hasProcessed = true;

for(i = 0, ii = info.length; i < ii; ++i){
toLoad.push(loadPlugin(aurelia, loader, info[i]));
Expand Down

0 comments on commit 9b37c84

Please sign in to comment.