From 21d84fbea4b6b427f5ce24cbb66ed80f26832baa Mon Sep 17 00:00:00 2001 From: Ian Bicking Date: Mon, 30 Sep 2019 17:42:49 -0500 Subject: [PATCH] Unmute other tabs as soon as you start typing --- extension/popup/popup.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/extension/popup/popup.js b/extension/popup/popup.js index 7f6391a16..77fa26312 100644 --- a/extension/popup/popup.js +++ b/extension/popup/popup.js @@ -75,11 +75,13 @@ this.popup = (function() { recorder.onBeginRecording = () => { browser.runtime.sendMessage({ type: "microphoneStarted" }); ui.setState("listening"); - ui.onStartTextInput = () => { + ui.onStartTextInput = async () => { + await browser.runtime.sendMessage({ type: "microphoneStopped" }); log.debug("detected text from the popup"); recorder.cancel(); // not sure if this is working as expected? }; - ui.onTextInput = text => { + ui.onTextInput = async text => { + await browser.runtime.sendMessage({ type: "microphoneStopped" }); ui.setState("success"); ui.setTranscript(text); executedIntent = true;