From a0fd6d965161011fc7641d098d559c7e7ed2a9cd Mon Sep 17 00:00:00 2001 From: cemaxecuter Date: Tue, 27 Jan 2026 11:31:20 -0500 Subject: [PATCH] Disable listen button when any agent is selected --- static/js/core/agents.js | 8 ++++++++ static/js/modes/listening-post.js | 1 + 2 files changed, 9 insertions(+) diff --git a/static/js/core/agents.js b/static/js/core/agents.js index cdee596..2854a2d 100644 --- a/static/js/core/agents.js +++ b/static/js/core/agents.js @@ -339,6 +339,10 @@ function selectAgent(agentId) { if (typeof BluetoothMode !== 'undefined' && BluetoothMode.handleAgentChange) { BluetoothMode.handleAgentChange(); } + // Re-enable listen button for local mode + if (typeof updateListenButtonState === 'function') { + updateListenButtonState(false); + } console.log('Agent selected: Local'); } else { // Fetch devices from remote agent @@ -357,6 +361,10 @@ function selectAgent(agentId) { if (typeof BluetoothMode !== 'undefined' && BluetoothMode.handleAgentChange) { BluetoothMode.handleAgentChange(); } + // Disable listen button for agent mode (audio can't stream over HTTP) + if (typeof updateListenButtonState === 'function') { + updateListenButtonState(true); + } const agentName = agents.find(a => a.id == agentId)?.name || 'Unknown'; console.log(`Agent selected: ${agentName}`); diff --git a/static/js/modes/listening-post.js b/static/js/modes/listening-post.js index 3308433..43e8331 100644 --- a/static/js/modes/listening-post.js +++ b/static/js/modes/listening-post.js @@ -2487,6 +2487,7 @@ function setListeningPostRunning(isRunning, agentId = null) { // Export for agent sync window.setListeningPostRunning = setListeningPostRunning; +window.updateListenButtonState = updateListenButtonState; // Export functions for HTML onclick handlers window.toggleDirectListen = toggleDirectListen;