fix: uploadFiles не теряет файлы после resetAll — сохраняет sf.slice()
Deploy drhider / validate (push) Waiting to run

This commit is contained in:
2026-07-14 19:31:44 +04:00
parent e513bf3c9e
commit cd29e727f3
2 changed files with 11 additions and 8 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ if _sys_path_root not in sys.path:
sys.path.insert(0, _sys_path_root)
# Версия приложения (меняется при изменениях)
VERSION = "0.0.24"
VERSION = "0.0.25"
def create_app():
+10 -7
View File
@@ -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 {