diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2018-06-17 21:42:52 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2018-06-17 22:04:00 +0900 |
commit | 7f56a08f3ba5407e6c8cdec12dc59aa71aa06d03 (patch) | |
tree | 3514ba669aabcc77f222fc6bc15f53c1d6982834 /src/console | |
parent | 48e4bccf0d24bb6ce53c4ecea567ed7750fe8949 (diff) |
Use async/await on content script
Diffstat (limited to 'src/console')
-rw-r--r-- | src/console/components/console.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/console/components/console.js b/src/console/components/console.js index a9ae4ed..417c9f6 100644 --- a/src/console/components/console.js +++ b/src/console/components/console.js @@ -107,16 +107,15 @@ export default class ConsoleComponent { } } - onInput(e) { + async onInput(e) { this.store.dispatch(consoleActions.setConsoleText(e.target.value)); let source = e.target.value; - return browser.runtime.sendMessage({ + let completions = await browser.runtime.sendMessage({ type: messages.CONSOLE_QUERY_COMPLETIONS, text: source, - }).then((completions) => { - this.store.dispatch(consoleActions.setCompletions(source, completions)); }); + this.store.dispatch(consoleActions.setCompletions(source, completions)); } onInputShown(state) { |