fix: uploadFiles не теряет файлы после resetAll — сохраняет sf.slice()
Deploy drhider / validate (push) Waiting to run
Deploy drhider / validate (push) Waiting to run
This commit is contained in:
@@ -176,18 +176,21 @@ function ss(idx, h) { const e = document.getElementById('st-' + idx); if (e) e.i
|
||||
|
||||
async function uploadFiles() {
|
||||
if (sf.length === 0) return;
|
||||
// Сохранить список до очистки
|
||||
const files = sf.slice();
|
||||
// Обрубить всё что могло остаться от предыдущего раза
|
||||
resetAll();
|
||||
ub.disabled = true;
|
||||
sf = Array.from(fi.files); // восстановить список после resetAll
|
||||
rr();
|
||||
ub.disabled = true;
|
||||
if (activeES) { activeES.close(); activeES = null; }
|
||||
if (activeXHR) { activeXHR.abort(); activeXHR = null; }
|
||||
currentSid = '';
|
||||
st.className = '';
|
||||
st.textContent = '';
|
||||
db.classList.remove('show');
|
||||
const total = sf.length;
|
||||
ub.disabled = true;
|
||||
const total = files.length;
|
||||
|
||||
// Фаза 1: загрузка (XMLHttpRequest — прогресс в строке)
|
||||
for (let i = 0; i < total; i++) {
|
||||
const f = sf[i], n = i + 1;
|
||||
const f = files[i], n = i + 1;
|
||||
st.className = 'status progress';
|
||||
st.textContent = 'Загрузка ' + n + '/' + total + ': ' + f.name;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user