mirror of
https://github.com/smittix/intercept.git
synced 2026-07-26 17:48:15 -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) {
|
if (typeof BluetoothMode !== 'undefined' && BluetoothMode.handleAgentChange) {
|
||||||
BluetoothMode.handleAgentChange();
|
BluetoothMode.handleAgentChange();
|
||||||
}
|
}
|
||||||
|
// Re-enable listen button for local mode
|
||||||
|
if (typeof updateListenButtonState === 'function') {
|
||||||
|
updateListenButtonState(false);
|
||||||
|
}
|
||||||
console.log('Agent selected: Local');
|
console.log('Agent selected: Local');
|
||||||
} else {
|
} else {
|
||||||
// Fetch devices from remote agent
|
// Fetch devices from remote agent
|
||||||
@@ -357,6 +361,10 @@ function selectAgent(agentId) {
|
|||||||
if (typeof BluetoothMode !== 'undefined' && BluetoothMode.handleAgentChange) {
|
if (typeof BluetoothMode !== 'undefined' && BluetoothMode.handleAgentChange) {
|
||||||
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';
|
const agentName = agents.find(a => a.id == agentId)?.name || 'Unknown';
|
||||||
console.log(`Agent selected: ${agentName}`);
|
console.log(`Agent selected: ${agentName}`);
|
||||||
|
|
||||||
|
|||||||
@@ -2487,6 +2487,7 @@ function setListeningPostRunning(isRunning, agentId = null) {
|
|||||||
|
|
||||||
// Export for agent sync
|
// Export for agent sync
|
||||||
window.setListeningPostRunning = setListeningPostRunning;
|
window.setListeningPostRunning = setListeningPostRunning;
|
||||||
|
window.updateListenButtonState = updateListenButtonState;
|
||||||
|
|
||||||
// Export functions for HTML onclick handlers
|
// Export functions for HTML onclick handlers
|
||||||
window.toggleDirectListen = toggleDirectListen;
|
window.toggleDirectListen = toggleDirectListen;
|
||||||
|
|||||||
Reference in New Issue
Block a user