fix: Save pendingFile ref before closeModal() nulls it

closeModal() was setting pendingFile = null, then confirmSubmit()
was trying to append the now-null pendingFile to FormData, causing
'No file uploaded' error on every submission.

Fix: capture pendingFile into fileToSubmit before calling closeModal().

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
Claude 2026-03-31 16:42:25 -04:00
parent 67533c1b24
commit 6711abb339

View file

@ -1086,10 +1086,11 @@
async function confirmSubmit() { async function confirmSubmit() {
if (!pendingFile) return; if (!pendingFile) return;
const fileToSubmit = pendingFile; // save ref before closeModal nulls it
closeModal(); closeModal();
const formData = new FormData(); const formData = new FormData();
formData.append('prproj', pendingFile); formData.append('prproj', fileToSubmit);
const progressEl = document.getElementById('upload-progress'); const progressEl = document.getElementById('upload-progress');
const statusEl = document.getElementById('upload-status'); const statusEl = document.getElementById('upload-status');