fix: an image still being read after leaving the product page no longer throws
All checks were successful
Build and deploy / Validate source (push) Successful in 9s
Build and deploy / Integration suite on a real stack (push) Successful in 4m19s
Build and deploy / Secret scan and release gate (push) Successful in 9s
Build and deploy / Publish images (push) Successful in 1m19s

"Voltar" closes the product page but leaves the artwork list; an image
whose reading finished afterwards repainted it with no product chosen and
threw (MODOS[null].larg). It now paints nothing. The artwork browser test
caught it now and then, failing CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-10-16 16:42:03 -03:00
parent 8df35049f7
commit bd718796c5

View File

@@ -406,6 +406,7 @@ function detalhesDaFolha(a,i,aberto){
linhas.map(l=>'<span>'+l+'</span>').join('')+'</details>';
}
function pintaFolha(){
if(!MODOS[modo]) return; // read after the customer left the product page
invalidaItemAtual();
const L=larguraFilme();
pintaTipoEnvio(); // trava o seletor enquanto houver folha
@@ -529,6 +530,9 @@ function pintaProgressoArte(a){
barra.style.width=a.lendo+'%'; if(texto) texto.textContent='arquivo grande · gerando a prévia · '+faltaLeitura(a.leitura);
}
function pintaArtes(){
// A file still being read when the customer left the product page lands
// here with no product open: nothing to paint.
if(!MODOS[modo]) return;
invalidaItemAtual();
$('zona').classList.toggle('compacta', artes.length>0);
// The same card as a finished sheet: thumbnail, size, a DPI chip, then the