|
@@ -179,7 +179,6 @@ function setupSearchListener() {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
const finded = smartSearch(Allproducts, searchTerm);
|
|
const finded = smartSearch(Allproducts, searchTerm);
|
|
|
- console.log(finded)
|
|
|
|
|
// Renderizar con animación
|
|
// Renderizar con animación
|
|
|
renderProductsWithAnimation(finded, false, searchTerm);
|
|
renderProductsWithAnimation(finded, false, searchTerm);
|
|
|
}, 200);
|
|
}, 200);
|
|
@@ -212,7 +211,6 @@ async function checkCache() {
|
|
|
userToken = tokenCache;
|
|
userToken = tokenCache;
|
|
|
try{
|
|
try{
|
|
|
const data = await getUserData(userToken);
|
|
const data = await getUserData(userToken);
|
|
|
- console.log(data)
|
|
|
|
|
user = data.data
|
|
user = data.data
|
|
|
}catch (error) {
|
|
}catch (error) {
|
|
|
console.error("Error fetching user data:", error);
|
|
console.error("Error fetching user data:", error);
|
|
@@ -221,7 +219,6 @@ async function checkCache() {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
if (user) {
|
|
if (user) {
|
|
|
- console.log("User data loaded from cache:", user);
|
|
|
|
|
userId = user.id;
|
|
userId = user.id;
|
|
|
userName = user.name;
|
|
userName = user.name;
|
|
|
updateProgress(user.reward_progress || 0);
|
|
updateProgress(user.reward_progress || 0);
|
|
@@ -356,7 +353,6 @@ async function renderProductsWithAnimation(products, groupInCategories = true, s
|
|
|
}else {
|
|
}else {
|
|
|
categoryContainers = [ { category: searchTerm, container: productListElement } ];
|
|
categoryContainers = [ { category: searchTerm, container: productListElement } ];
|
|
|
}
|
|
}
|
|
|
- console.log("Category containers created:", categoryContainers);
|
|
|
|
|
if (products.length === 0) {
|
|
if (products.length === 0) {
|
|
|
const noProductsMessage = document.createElement("p");
|
|
const noProductsMessage = document.createElement("p");
|
|
|
noProductsMessage.textContent = "No hay productos disponibles.";
|
|
noProductsMessage.textContent = "No hay productos disponibles.";
|