diff --git a/lib/dashboard/console.js b/lib/dashboard/console.js index cdd58606..907e9844 100644 --- a/lib/dashboard/console.js +++ b/lib/dashboard/console.js @@ -28,9 +28,6 @@ class Console { 'The web3 object and the interfaces for the deployed contracts and their methods are also available' ]; return helpText.join('\n'); - } else if (cmd === 'test') { - this.events.request("console:command", "help", () => {}); - return "test"; } else if (['quit', 'exit', 'sair', 'sortir'].indexOf(cmd) >= 0) { utils.exit(); } diff --git a/lib/dashboard/monitor.js b/lib/dashboard/monitor.js index 7edeeaf6..ab86a96d 100644 --- a/lib/dashboard/monitor.js +++ b/lib/dashboard/monitor.js @@ -344,22 +344,26 @@ class Dashboard { self.input.focus(); }); - this.input.on('submit', this.executeCmd.bind(this)); + this.input.on('submit', this.submitCmd.bind(this)); this.screen.append(this.consoleBox); } + submitCmd(cmd) { + if (cmd !== '') { + this.history.addCommand(cmd); + this.executeCmd(cmd); + } + this.input.clearValue(); + this.input.focus(); + } + executeCmd(cmd) { const self = this; - if (cmd !== '') { - self.history.addCommand(cmd); - self.logText.log('console> '.bold.green + cmd); - self.console.executeCmd(cmd, function (result) { - self.logText.log(result); - }); - } - self.input.clearValue(); - self.input.focus(); + self.logText.log('console> '.bold.green + cmd); + self.console.executeCmd(cmd, function (result) { + self.logText.log(result); + }); } }