ext: state-driven toolbar icon, restyled popup
This commit is contained in:
+2
-1
@@ -11,6 +11,7 @@ let recorderState = { state: "idle" }, lastError = "";
|
||||
// Refresh the button and status line from state recorderState.
|
||||
function render() {
|
||||
const goButton = byId("go"), statusLine = byId("st");
|
||||
document.body.dataset.state = recorderState.state;
|
||||
// Pipeline busy after stop: no new start until it finishes.
|
||||
goButton.disabled = recorderState.state === "transcribing";
|
||||
// Button doubles as Stop while recording.
|
||||
@@ -61,7 +62,7 @@ byId("go").onclick = async () => {
|
||||
// Tell teams.js to start its scanners; ignored if the content script is not on this tab.
|
||||
chrome.tabs.sendMessage(activeTab.id, { cmd: "cap-start" }).catch(() => {});
|
||||
// Any failure is shown in the status line.
|
||||
} catch (error) { lastError = String(error); }
|
||||
} catch (error) { lastError = String(error); chrome.runtime.sendMessage({ to: "bg", state: "error" }); }
|
||||
render(); poll();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user