This commit is contained in:
2026-05-31 20:38:45 +02:00
parent 8e4e40d92f
commit b2128ef0f8

View File

@@ -770,7 +770,11 @@ window.initUploadForm = (selector) => {
// If files were provided, process them (append or replace) // If files were provided, process them (append or replace)
if (files && files.length > 0) { if (files && files.length > 0) {
const filesToProcess = isShitpost ? Array.from(files) : [files[0]]; const filesToProcess = isShitpost ? Array.from(files) : [files[0]];
if (!isShitpost) selectedFiles = []; // Reset for normal mode if (!isShitpost) {
selectedFiles = []; // Reset for normal mode — replace, not append
// Also wipe the preview DOM so the old card doesn't linger
if (filePreview) filePreview.innerHTML = '';
}
for (const file of filesToProcess) { for (const file of filesToProcess) {
if (!file) continue; if (!file) continue;