fix issue with repeating console input
This commit is contained in:
parent
531af6234b
commit
a231f11062
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue