Disable listen button when any agent is selected

This commit is contained in:
cemaxecuter
2026-01-27 11:31:20 -05:00
parent 8d505eb848
commit a0fd6d9651
2 changed files with 9 additions and 0 deletions

View File

@@ -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}`);