remove comparison with previous value
This commit is contained in:
parent
3a1940a0c3
commit
774a960a83
1 changed files with 1 additions and 9 deletions
|
@ -4,7 +4,6 @@ import * as consoleActions from 'console/actions/console';
|
|||
export default class ConsoleComponent {
|
||||
constructor(wrapper, store) {
|
||||
this.wrapper = wrapper;
|
||||
this.prevValue = '';
|
||||
this.prevState = {};
|
||||
this.completionOrigin = '';
|
||||
this.store = store;
|
||||
|
@ -50,19 +49,13 @@ export default class ConsoleComponent {
|
|||
}
|
||||
|
||||
onInput(e) {
|
||||
let targetValue = e.target.value;
|
||||
if (targetValue === this.prevValue) {
|
||||
return;
|
||||
}
|
||||
|
||||
let doc = this.wrapper.ownerDocument;
|
||||
let input = doc.querySelector('#vimvixen-console-command-input');
|
||||
this.completionOrigin = input.value;
|
||||
|
||||
this.prevValue = targetValue;
|
||||
return browser.runtime.sendMessage({
|
||||
type: messages.CONSOLE_QUERY_COMPLETIONS,
|
||||
text: targetValue
|
||||
text: e.target.value,
|
||||
}).then((completions) => {
|
||||
this.store.dispatch(consoleActions.setCompletions(completions));
|
||||
});
|
||||
|
@ -107,7 +100,6 @@ export default class ConsoleComponent {
|
|||
input.focus();
|
||||
|
||||
window.focus();
|
||||
this.prevValue = '';
|
||||
this.onInput({ target: input });
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue