From bc4e1bfc85f744b50f30f06dd70c37c1a27f96a0 Mon Sep 17 00:00:00 2001 From: Lemuel Marquez Date: Mon, 18 Jan 2021 15:14:02 -0600 Subject: [PATCH] error 3 --- server/db/antiguo.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/server/db/antiguo.js b/server/db/antiguo.js index b1eac82..8ebb90e 100644 --- a/server/db/antiguo.js +++ b/server/db/antiguo.js @@ -326,14 +326,11 @@ const carpetasRepetidas = async () => { let repetidas = []; for (let i = 0; i < carpetas.length; i++) { + let aux = [carpetas[i]]; for (let j = i + 1; j < carpetas.length; j++) { - if (carpetas[i].name === carpetas[j].name) repetidas.push(carpetas[j]); - else { - repetidas.push(carpetas[i]); - i = j - 1; - break; - } + if (carpetas[i].name === carpetas[j].name) carpetas.push(carpetas[j]); } + if (aux.length > 1) repetidas.push(aux); } console.log(carpetas.length); console.log(carpetas);