mirror of
https://github.com/myronblair/jarvis
synced 2026-06-30 17:50:23 -05:00
fix: kiosk voice reliability — stopListening on exit, exitVoiceMode kiosk guard
- stopListening() called in both toggleKiosk exit and _onFsChange so mic stops when leaving kiosk (was staying live indefinitely) - exitVoiceMode() now returns early if kiosk-mode active so the 30-min idle timer and face-detection loop cannot kill the always-on mic
This commit is contained in:
@@ -1405,6 +1405,7 @@ function enterVoiceMode(source) {
|
||||
}
|
||||
|
||||
function exitVoiceMode() {
|
||||
if (document.body.classList.contains('kiosk-mode')) return;
|
||||
voiceMode = false;
|
||||
voiceMuted = false;
|
||||
updateMicBtn();
|
||||
@@ -1794,6 +1795,7 @@ async function toggleKiosk() {
|
||||
if (ex) ex.call(document).catch(() => {});
|
||||
if (_wakeLock) { _wakeLock.release().catch(() => {}); _wakeLock = null; }
|
||||
document.body.classList.remove("kiosk-mode");
|
||||
if (typeof stopListening === "function") stopListening();
|
||||
if (btn) { btn.textContent = "⧞ KIOSK"; btn.style.color = ""; }
|
||||
if (!isTablet()) document.body.classList.remove("tablet-mode");
|
||||
}
|
||||
@@ -1810,6 +1812,7 @@ function _onFsChange() {
|
||||
if (!document.fullscreenElement && !document.webkitFullscreenElement) {
|
||||
if (_wakeLock) { _wakeLock.release().catch(() => {}); _wakeLock = null; }
|
||||
document.body.classList.remove("kiosk-mode");
|
||||
if (typeof stopListening === "function") stopListening();
|
||||
if (btn) { btn.textContent = "⧞ KIOSK"; btn.style.color = ""; }
|
||||
if (!isTablet()) document.body.classList.remove("tablet-mode");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user