fix(display): corregir turnos que no aparecen en pantalla TV
- sse_turno.php: sleep(2)→sleep(1) para detectar notificarSSE en máx 1s - display*.php: visibilitychange + focus → fetch inmediato al despertar pantalla - display*.php: Wake Lock API para evitar throttling del browser en TVs - display.php: SSE open → cargarSnapshot() inmediato al reconectar Causa raíz: browsers throttlean setInterval a >1min en tabs sin foco; las TVs inactivas dejaban de recibir actualizaciones aunque el servidor las enviara correctamente. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
8760b685ad
commit
d24b234e30
@@ -373,6 +373,17 @@ async function cargar() {
|
||||
|
||||
cargar();
|
||||
setInterval(cargar, 2000);
|
||||
|
||||
document.addEventListener('visibilitychange', () => { if (!document.hidden) cargar(); });
|
||||
window.addEventListener('focus', cargar);
|
||||
|
||||
if ('wakeLock' in navigator) {
|
||||
async function pedirWakeLock() {
|
||||
try { await navigator.wakeLock.request('screen'); } catch (_) {}
|
||||
}
|
||||
pedirWakeLock();
|
||||
document.addEventListener('visibilitychange', () => { if (!document.hidden) pedirWakeLock(); });
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user