From 6f72a4e711011b7a938119a392036755099ccad1 Mon Sep 17 00:00:00 2001 From: NguyenND Date: Mon, 1 Jun 2026 13:03:04 -0400 Subject: [PATCH] 06/01 Fix PDF statement import issue --- app/templates/bank_import/index.html | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/app/templates/bank_import/index.html b/app/templates/bank_import/index.html index 2725ce3..e7cc854 100644 --- a/app/templates/bank_import/index.html +++ b/app/templates/bank_import/index.html @@ -339,16 +339,15 @@ } function setParseLoading(on) { - $('parse-spinner').classList.toggle('d-none', !on); - $('parse-icon').classList.toggle('d-none', on); - $('parse-btn').disabled = on; - // PDF parsing calls Groq and can take 15-30 s — show a helpful message - if (on && selectedFile && selectedFile.name.toLowerCase().endsWith('.pdf')) { - $('parse-btn').textContent = ''; - $('parse-btn').appendChild($('parse-spinner')); - $('parse-btn').append(' Analysing PDF with AI… (may take ~20s)'); - } else if (!on) { - $('parse-btn').innerHTML = + const btn = $('parse-btn'); + btn.disabled = on; + if (on) { + const isPdf = selectedFile && selectedFile.name.toLowerCase().endsWith('.pdf'); + const label = isPdf ? 'Analysing PDF with AI… (may take ~20s)' : 'Parsing…'; + btn.innerHTML = + '' + label; + } else { + btn.innerHTML = '' + 'Parse Statement'; }