From b2128ef0f85d70d762c0be8d3082da5485b0d911 Mon Sep 17 00:00:00 2001 From: Kibi Kelburton Date: Sun, 31 May 2026 20:38:45 +0200 Subject: [PATCH] jjj --- public/s/js/upload.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/s/js/upload.js b/public/s/js/upload.js index 951a5ff..0bb4378 100644 --- a/public/s/js/upload.js +++ b/public/s/js/upload.js @@ -770,7 +770,11 @@ window.initUploadForm = (selector) => { // If files were provided, process them (append or replace) if (files && files.length > 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) { if (!file) continue;