From 449b492eea13139c206624d7012f9d99cb3fe70c Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Wed, 24 Jun 2026 01:00:26 -0500 Subject: [PATCH] =?UTF-8?q?fix:=20turno=20aparec=C3=ADa=203=20veces=20en?= =?UTF-8?q?=20lista=20de=20llamados=20en=20display=5Fglobal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit El llamados.unshift no estaba protegido por callKey, así que el mismo turno se agregaba una vez por cada escritorio de recepción. Ahora tanto el anuncio como la entrada en la lista usan el mismo guard callKey. Co-Authored-By: Claude Sonnet 4.6 --- modules/turnero/views/display_global.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/turnero/views/display_global.php b/modules/turnero/views/display_global.php index 25fdd86..e863ad6 100644 --- a/modules/turnero/views/display_global.php +++ b/modules/turnero/views/display_global.php @@ -622,13 +622,15 @@ function renderSnapshot(snap) { if (!lastSeenKeys.has(key)) { const c = t.prioridad_color || ''; const nomVoz = t.paciente_id ? t.paciente_nombre : null; - if (!_firstLoad && !announcedCalls.has(callKey)) { + if (!announcedCalls.has(callKey)) { announcedCalls.add(callKey); - queueAnnouncement({ _key: key, codigo: t.codigo, destino: t.destino, paciente: nomVoz, color: c }); + if (!_firstLoad) { + queueAnnouncement({ _key: key, codigo: t.codigo, destino: t.destino, paciente: nomVoz, color: c }); + } + llamados.unshift({ codigo: t.codigo, destino: t.destino, paciente: t.paciente_nombre, color: c }); + if (llamados.length > 30) llamados.pop(); + anuncioNuevo = true; } - llamados.unshift({ codigo: t.codigo, destino: t.destino, paciente: t.paciente_nombre, color: c }); - if (llamados.length > 30) llamados.pop(); - anuncioNuevo = true; } }); lastSeenKeys = currentKeys;