turnero: countdown en padre para que alerta sobreviva al cerrar el modal

El iframe pasa targetMs al padre via postMessage. El padre corre su propio
intervalo (5s) que dispara la notificación si el modal está cerrado.
Si el iframe alcanza el 0 primero, cancela el del padre para no duplicar.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-07-21 09:38:25 -05:00
co-authored by Claude Sonnet 4.6
parent 019d2f4fb0
commit 2cd7525bb4
2 changed files with 27 additions and 6 deletions
+1 -1
View File
@@ -2180,7 +2180,7 @@ function _mpIniciarCountdown(targetMsOrMins, nextLabel, nextFirmaId) {
if (box._mpTick) clearInterval(box._mpTick);
// Notificar al padre que bloquee el cierre
try { window.parent.postMessage({ type: 'tomaProgresivaIniciada' }, '*'); } catch(e) {}
try { window.parent.postMessage({ type: 'tomaProgresivaIniciada', targetMs: targetMs, label: nextLabel || '' }, '*'); } catch(e) {}
var _tcCdEl = nextFirmaId ? document.getElementById('tc-cd-' + nextFirmaId) : null;