Only call resetInputHistory when there is something to reset
This commit is contained in:
parent
c428842db7
commit
7e080f2c99
File diff suppressed because one or more lines are too long
@ -7,7 +7,7 @@ export default class MessageInput extends PureComponent {
|
|||||||
|
|
||||||
handleKey = e => {
|
handleKey = e => {
|
||||||
const { tab, runCommand, sendMessage, addInputHistory, incrementInputHistory,
|
const { tab, runCommand, sendMessage, addInputHistory, incrementInputHistory,
|
||||||
decrementInputHistory, resetInputHistory } = this.props;
|
decrementInputHistory, resetInputHistory, history } = this.props;
|
||||||
|
|
||||||
if (e.key === 'Enter' && e.target.value) {
|
if (e.key === 'Enter' && e.target.value) {
|
||||||
if (e.target.value[0] === '/') {
|
if (e.target.value[0] === '/') {
|
||||||
@ -24,7 +24,7 @@ export default class MessageInput extends PureComponent {
|
|||||||
incrementInputHistory();
|
incrementInputHistory();
|
||||||
} else if (e.key === 'ArrowDown') {
|
} else if (e.key === 'ArrowDown') {
|
||||||
decrementInputHistory();
|
decrementInputHistory();
|
||||||
} else {
|
} else if (history) {
|
||||||
this.setState({ value: e.target.value });
|
this.setState({ value: e.target.value });
|
||||||
resetInputHistory();
|
resetInputHistory();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user