mirror of
https://github.com/smittix/intercept.git
synced 2026-04-25 07:10:00 -07:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -2474,8 +2474,10 @@ function setListeningPostRunning(isRunning, agentId = null) {
|
||||
// Update status
|
||||
updateScannerDisplay('IDLE', 'var(--text-secondary)');
|
||||
|
||||
// Re-enable listen button
|
||||
updateListenButtonState(false);
|
||||
// Only re-enable listen button if we're in local mode
|
||||
// (agent mode can't stream audio over HTTP)
|
||||
const isAgentMode = typeof currentAgent !== 'undefined' && currentAgent !== 'local';
|
||||
updateListenButtonState(isAgentMode);
|
||||
|
||||
// Clear polling
|
||||
if (listeningPostPollTimer) {
|
||||
|
||||
Reference in New Issue
Block a user