From e3e8cfd55ec15c3b5085ab111498a7e3ba6dcaa9 Mon Sep 17 00:00:00 2001 From: Collina Systems Date: Sun, 5 Jul 2026 12:51:02 -0600 Subject: [PATCH] =?UTF-8?q?polish(checada):=20confirmaci=C3=B3n=20gu=C3=AD?= =?UTF-8?q?a=20el=20segundo=20tap=20y=20aclara=20el=20token=20de=20un=20so?= =?UTF-8?q?lo=20uso?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - tras una ENTRADA: 'Entrada registrada a las HH:MM … vuelve a acercar el celular al chip para registrar tu salida' (una checada = un tap; entrada y salida son dos taps) - token ya usado: 'Este código ya se usó … acerca de nuevo el celular al chip' con tono informativo (azul), no de error: el uso único es lo correcto - el título usa el tipo REAL que devuelve el backend (resultado.tipo), no lo que pulsó el becario, así que refleja el toggle aunque haya habido conflicto --- frontend/checada.html | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/frontend/checada.html b/frontend/checada.html index b5e777a..c8eadf4 100644 --- a/frontend/checada.html +++ b/frontend/checada.html @@ -36,6 +36,7 @@ const COLORS = { }; const FONT = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif"; const fmtHoras = (h) => `${(h ?? 0).toLocaleString("es-MX", { maximumFractionDigits: 1 })} h`; +const fmtHM = (iso) => (iso ? new Date(iso).toLocaleTimeString("es-MX", { timeZone: "America/Mexico_City", hour: "2-digit", minute: "2-digit" }) : ""); const Shell = ({ children }) => (
@@ -145,11 +146,19 @@ function Checar({ token }) { } if (resultado) { + // Token de un solo uso ya consumido: no es error del becario, es lo correcto. if (resultado.duplicada) - return ; + return ; + // El título refleja el tipo REAL que aplicó el backend (toggle), no lo que + // pulsó el becario — si hubo conflicto ya se reconfirmó antes de llegar aquí. const esEntrada = resultado.tipo === "entrada"; - return ; + const hora = fmtHM(resultado.ts); + if (esEntrada) + return ; + return ; } const esEntrada = ctx.tipo_sugerido === "entrada";