Fix listen button not disabling when agent selected

- Add fallback direct DOM manipulation in agents.js selectAgent()
- Fix setListeningPostRunning to check agent mode before re-enabling button
- Add debug logging for button state changes
This commit is contained in:
cemaxecuter
2026-01-27 11:44:30 -05:00
parent a0fd6d9651
commit 077d46f319
2 changed files with 20 additions and 2 deletions

View File

@@ -340,6 +340,14 @@ function selectAgent(agentId) {
BluetoothMode.handleAgentChange();
}
// Re-enable listen button for local mode
const listenBtn = document.getElementById('radioListenBtn');
console.log('[agents.js] Enabling listen button, found:', listenBtn);
if (listenBtn) {
listenBtn.disabled = false;
listenBtn.style.opacity = '1';
listenBtn.style.cursor = 'pointer';
listenBtn.title = 'Listen to current frequency';
}
if (typeof updateListenButtonState === 'function') {
updateListenButtonState(false);
}
@@ -362,6 +370,14 @@ function selectAgent(agentId) {
BluetoothMode.handleAgentChange();
}
// Disable listen button for agent mode (audio can't stream over HTTP)
const listenBtn = document.getElementById('radioListenBtn');
console.log('[agents.js] Disabling listen button, found:', listenBtn);
if (listenBtn) {
listenBtn.disabled = true;
listenBtn.style.opacity = '0.5';
listenBtn.style.cursor = 'not-allowed';
listenBtn.title = 'Audio listening not available for remote agents';
}
if (typeof updateListenButtonState === 'function') {
updateListenButtonState(true);
}