06/01 Fix PDF statement import issue

This commit is contained in:
2026-06-01 13:03:04 -04:00
parent fcd005043e
commit 6f72a4e711
+9 -10
View File
@@ -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 =
'<span class="spinner-border spinner-border-sm me-1"></span>' + label;
} else {
btn.innerHTML =
'<span id="parse-spinner" class="spinner-border spinner-border-sm me-1 d-none"></span>' +
'<i class="bi bi-search me-1" id="parse-icon"></i>Parse Statement';
}