From 7f56a08f3ba5407e6c8cdec12dc59aa71aa06d03 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 17 Jun 2018 21:42:52 +0900 Subject: Use async/await on content script --- src/console/components/console.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/console/components/console.js') 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) { -- cgit v1.2.3