fix(ecommerce): corregir error de tipos en indice de tile promocional
Build and Push Frontend / Escaneo de Secretos (Gitleaks) (pull_request) Successful in 25s
Build and Push Frontend / Construir y Subir Imagen (pull_request) Skipped

tsconfig tiene noUncheckedIndexedAccess -- promoRoots[promoIndex %
promoRoots.length] tipa como Category | undefined aunque en runtime
siempre es valido (promoRoots.length > 0 ya se verifico antes de este
punto). Extraido a una constante con guard explicito para que TS
angoste el tipo. Sin cambio de comportamiento.

Detectado por el build real en main tras el merge de #41 -- no se
puede correr tsc localmente en esta maquina (ver notas de sesiones
anteriores), asi que esto solo lo valida el CI post-merge.
This commit is contained in:
devops committed 2026-08-25 15:18:12 -05:00
1 parent e7699befc5
commit 3c0ce03e09
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;
}
});