remove previous listener (for now)

This commit is contained in:
Iuri Matias 2018-05-16 13:11:44 -04:00
parent b7fc3f9054
commit ce781ab96e
2 changed files with 9 additions and 5 deletions

View File

@ -101,9 +101,11 @@ class CodeGenerator {
self.buildWeb3JS(cb); self.buildWeb3JS(cb);
}); });
this.events.setCommandHandler('code-generator:contract', (contractName, cb) => { this.events.removeListener('code-generator:contract', () => {
let contract = self.contractsManager.contracts[contractName]; self.events.setCommandHandler('code-generator:contract', (contractName, cb) => {
self.buildContractJS(contractName, self.generateContractJSON(contractName, contract), cb); let contract = self.contractsManager.contracts[contractName];
self.buildContractJS(contractName, self.generateContractJSON(contractName, contract), cb);
});
}); });
} }

View File

@ -27,8 +27,10 @@ class ContractsManager {
}); });
const self = this; const self = this;
this.events.setCommandHandler('contracts:list', (cb) => { this.events.removeListener('contracts:list', () => {
cb(self.listContracts()); self.events.setCommandHandler('contracts:list', (cb) => {
cb(self.listContracts());
});
}); });
} }