diff --git a/frontend/package.json b/frontend/package.json index 3f65a00..33ded95 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,7 +1,7 @@ { "name": "checklist-frontend", "private": true, - "version": "1.3.5", + "version": "1.3.6", "type": "module", "scripts": { "dev": "vite", diff --git a/frontend/public/service-worker.js b/frontend/public/service-worker.js index 4bb06fb..99e9fb1 100644 --- a/frontend/public/service-worker.js +++ b/frontend/public/service-worker.js @@ -1,6 +1,6 @@ // Service Worker para PWA con detección de actualizaciones // IMPORTANTE: Actualizar esta versión cada vez que se despliegue una nueva versión -const CACHE_NAME = 'ayutec-v1.3.5'; +const CACHE_NAME = 'ayutec-v1.3.6'; const urlsToCache = [ '/', '/index.html' diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index dc71da6..e784da6 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -4247,6 +4247,9 @@ function InspectionModal({ checklist, existingInspection, user, onClose, onCompl const [currentQuestionIndex, setCurrentQuestionIndex] = useState(0) const [aiAnalyzing, setAiAnalyzing] = useState(false) + // Sistema anti-duplicados: rastrear último guardado por pregunta + const lastSaveTimestamp = useRef({}) + // AI Assistant Chat const [showAIChat, setShowAIChat] = useState(false) const [aiChatMessages, setAiChatMessages] = useState([]) @@ -4419,6 +4422,17 @@ function InspectionModal({ checklist, existingInspection, user, onClose, onCompl return } + // ANTI-DUPLICADOS: Verificar si se guardó en el último segundo + const now = Date.now() + const lastSave = lastSaveTimestamp.current[questionId] || 0 + if (now - lastSave < 1000) { + console.log(`⏭️ Saltando guardado duplicado para pregunta ${questionId} (última guardada hace ${now - lastSave}ms)`) + return + } + + // Marcar timestamp de guardado + lastSaveTimestamp.current[questionId] = now + try { const token = localStorage.getItem('token') const API_URL = import.meta.env.VITE_API_URL || '' diff --git a/frontend/src/Sidebar.jsx b/frontend/src/Sidebar.jsx index c2e0638..7cd0cf4 100644 --- a/frontend/src/Sidebar.jsx +++ b/frontend/src/Sidebar.jsx @@ -153,7 +153,7 @@ export default function Sidebar({ user, activeTab, setActiveTab, sidebarOpen, se className="w-10 h-10 object-contain bg-white rounded p-1" />
- Ayutec v1.3.5 + Ayutec v1.3.6
diff --git a/lineas.ps1 b/lineas.ps1 new file mode 100644 index 0000000..5191114 --- /dev/null +++ b/lineas.ps1 @@ -0,0 +1,41 @@ +param( + [Parameter(Mandatory=$true)] + [string]$Fecha +) + +# Convertir fecha dd/mm/aaaa → yyyy-mm-dd +try { + $dateObj = [datetime]::ParseExact($Fecha, "dd/MM/yyyy", $null) +} catch { + Write-Host "❌ Formato inválido. Usa dd/mm/aaaa (ej: 05/12/2025)" + exit +} + +$FechaISO = $dateObj.ToString("yyyy-MM-dd") + +$desde = "$FechaISO 00:00" +$hasta = "$FechaISO 23:59" + +$added = 0 +$removed = 0 + +git log --since="$desde" --until="$hasta" --pretty=tformat: --numstat | + ForEach-Object { + $cols = $_.Split() + + # Saltar líneas vacías + if ($cols.Length -lt 2) { return } + + # Si Git muestra "-", ignorar esta línea + if ($cols[0] -eq "-" -or $cols[1] -eq "-") { return } + + # Sumar líneas + $added += [int]$cols[0] + $removed += [int]$cols[1] + } + +Write-Host "Fecha ingresada: $Fecha" +Write-Host "Fecha usada (ISO): $FechaISO" +Write-Host "Líneas añadidas: $added" +Write-Host "Líneas eliminadas: $removed" +Write-Host "Total neto: " ($added - $removed)