mirror of
https://github.com/smittix/intercept.git
synced 2026-05-29 21:39:26 -07:00
Disable listen button when any agent is selected
This commit is contained in:
@@ -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}`);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user