feature/implementacion de hub en EFC

This commit is contained in:
2026-06-08 07:19:29 -06:00
parent 6e2634d11b
commit 1c6b07be58
23 changed files with 2178 additions and 1039 deletions

View File

@@ -35,7 +35,20 @@ export function useTaskProgress() {
function loadFromStorage() {
try {
const raw = localStorage.getItem(STORAGE_KEY);
return raw ? JSON.parse(raw) : [];
if (!raw) return [];
const tasks = JSON.parse(raw);
const cutoff = Date.now() - 24 * 60 * 60 * 1000; // 24 horas
// Auto-descartar tareas "processing/submitted" con más de 24h (nunca terminaron)
return tasks.map(t => {
if (
(t.status === 'processing' || t.status === 'submitted') &&
t.started_at &&
new Date(t.started_at).getTime() < cutoff
) {
return { ...t, dismissed: true, status: 'failed', message: 'Tarea expirada' };
}
return t;
});
} catch {
return [];
}