Merge pull request 'fix(ecommerce): corregir error de tipos en indice de tile promocional' (#42) from fix/etapa2-subfase3-fix-promo-index-type into main
This commit was merged in pull request #42.
This commit is contained in:
commit
b6e3bddbc6
1 file changed
+3
-2
@@ -144,8 +144,9 @@ export function CatalogClient({
|
||||
filtered.forEach((product, index) => {
|
||||
items.push({ type: "product", product });
|
||||
const isLast = index === filtered.length - 1;
|
||||
if (!isLast && (index + 1) % PROMO_TILE_INTERVAL === 0) {
|
||||
items.push({ type: "promo", category: promoRoots[promoIndex % promoRoots.length] });
|
||||
const promoCategory = promoRoots[promoIndex % promoRoots.length];
|
||||
if (!isLast && (index + 1) % PROMO_TILE_INTERVAL === 0 && promoCategory) {
|
||||
items.push({ type: "promo", category: promoCategory });
|
||||
promoIndex += 1;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user