06/01 Fix PDF statement import issue
This commit is contained in:
@@ -339,16 +339,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setParseLoading(on) {
|
function setParseLoading(on) {
|
||||||
$('parse-spinner').classList.toggle('d-none', !on);
|
const btn = $('parse-btn');
|
||||||
$('parse-icon').classList.toggle('d-none', on);
|
btn.disabled = on;
|
||||||
$('parse-btn').disabled = on;
|
if (on) {
|
||||||
// PDF parsing calls Groq and can take 15-30 s — show a helpful message
|
const isPdf = selectedFile && selectedFile.name.toLowerCase().endsWith('.pdf');
|
||||||
if (on && selectedFile && selectedFile.name.toLowerCase().endsWith('.pdf')) {
|
const label = isPdf ? 'Analysing PDF with AI… (may take ~20s)' : 'Parsing…';
|
||||||
$('parse-btn').textContent = '';
|
btn.innerHTML =
|
||||||
$('parse-btn').appendChild($('parse-spinner'));
|
'<span class="spinner-border spinner-border-sm me-1"></span>' + label;
|
||||||
$('parse-btn').append(' Analysing PDF with AI… (may take ~20s)');
|
} else {
|
||||||
} else if (!on) {
|
btn.innerHTML =
|
||||||
$('parse-btn').innerHTML =
|
|
||||||
'<span id="parse-spinner" class="spinner-border spinner-border-sm me-1 d-none"></span>' +
|
'<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';
|
'<i class="bi bi-search me-1" id="parse-icon"></i>Parse Statement';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user