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:
2026-06-21 14:26:54 +00:00
parent 51b598dd5d
commit 95d49f15cb
2 changed files with 9 additions and 6 deletions
+3
View File
@@ -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");
}