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