remove comparison with previous value

jh-changes
Shin'ya Ueoka 7 years ago
parent 3a1940a0c3
commit 774a960a83
  1. 10
      src/console/components/console.js

@ -4,7 +4,6 @@ import * as consoleActions from 'console/actions/console';
export default class ConsoleComponent { export default class ConsoleComponent {
constructor(wrapper, store) { constructor(wrapper, store) {
this.wrapper = wrapper; this.wrapper = wrapper;
this.prevValue = '';
this.prevState = {}; this.prevState = {};
this.completionOrigin = ''; this.completionOrigin = '';
this.store = store; this.store = store;
@ -50,19 +49,13 @@ export default class ConsoleComponent {
} }
onInput(e) { onInput(e) {
let targetValue = e.target.value;
if (targetValue === this.prevValue) {
return;
}
let doc = this.wrapper.ownerDocument; let doc = this.wrapper.ownerDocument;
let input = doc.querySelector('#vimvixen-console-command-input'); let input = doc.querySelector('#vimvixen-console-command-input');
this.completionOrigin = input.value; this.completionOrigin = input.value;
this.prevValue = targetValue;
return browser.runtime.sendMessage({ return browser.runtime.sendMessage({
type: messages.CONSOLE_QUERY_COMPLETIONS, type: messages.CONSOLE_QUERY_COMPLETIONS,
text: targetValue text: e.target.value,
}).then((completions) => { }).then((completions) => {
this.store.dispatch(consoleActions.setCompletions(completions)); this.store.dispatch(consoleActions.setCompletions(completions));
}); });
@ -107,7 +100,6 @@ export default class ConsoleComponent {
input.focus(); input.focus();
window.focus(); window.focus();
this.prevValue = '';
this.onInput({ target: input }); this.onInput({ target: input });
} }