fix(ecommerce): corregir error de tipos en indice de tile promocional #42
@@ -144,8 +144,9 @@ export function CatalogClient({
|
|||||||
filtered.forEach((product, index) => {
|
filtered.forEach((product, index) => {
|
||||||
items.push({ type: "product", product });
|
items.push({ type: "product", product });
|
||||||
const isLast = index === filtered.length - 1;
|
const isLast = index === filtered.length - 1;
|
||||||
if (!isLast && (index + 1) % PROMO_TILE_INTERVAL === 0) {
|
const promoCategory = promoRoots[promoIndex % promoRoots.length];
|
||||||
items.push({ type: "promo", category: promoRoots[promoIndex % promoRoots.length] });
|
if (!isLast && (index + 1) % PROMO_TILE_INTERVAL === 0 && promoCategory) {
|
||||||
|
items.push({ type: "promo", category: promoCategory });
|
||||||
promoIndex += 1;
|
promoIndex += 1;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in new issue
Block a user