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:
parent
67533c1b24
commit
6711abb339
1 changed files with 2 additions and 1 deletions
|
|
@ -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');
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue