Skip to content
This repository has been archived by the owner on Feb 26, 2021. It is now read-only.

Commit

Permalink
Fix #300, unmute tabs as soon as processing starts
Browse files Browse the repository at this point in the history
  • Loading branch information
ianb committed Sep 27, 2019
1 parent 0ad3df8 commit ea2ed25
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions extension/popup/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ this.popup = (function() {
};
};
recorder.onEnd = json => {
// Probably superfluous, since this is called in onProcessing:
browser.runtime.sendMessage({ type: "microphoneStopped" });
clearInterval(intervalId);
ui.setState("success");
Expand All @@ -112,14 +113,18 @@ this.popup = (function() {
});
};
recorder.onError = error => {
browser.runtime.sendMessage({ type: "microphoneStopped" });
log.error("Got recorder error:", String(error), error);
ui.setState("error");
clearInterval(intervalId);
};
recorder.onProcessing = () => {
browser.runtime.sendMessage({ type: "microphoneStopped" });

ui.setState("processing");
};
recorder.onNoVoice = () => {
browser.runtime.sendMessage({ type: "microphoneStopped" });
log.debug("Closing popup because of no voice input");
window.close();
};
Expand Down

0 comments on commit ea2ed25

Please sign in to comment.