From 9b09f8a20ca7bae974a6dce4ef3e18d6e4451843 Mon Sep 17 00:00:00 2001 From: Sterling Archer Date: Tue, 9 Jun 2026 14:58:23 -0700 Subject: [PATCH] fix: upload button now uses same smart routing as drag-and-drop instead of always resetting fields --- index.html | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 736f55a..0862b2e 100644 --- a/index.html +++ b/index.html @@ -853,7 +853,20 @@ uploadBtn.addEventListener('click', () => { uploadAnyInput.addEventListener('change', e => { const file = e.target.files[0]; - if (file) processFile(file); + if (!file) return; + if (outputSection.style.display && outputSection.style.display !== 'none') { + const name = file.name.toLowerCase(); + const isDataFormat = name.endsWith('.fit') || name.endsWith('.fits') || + name.endsWith('.cr2') || name.endsWith('.cr3') || + name.endsWith('.tif') || name.endsWith('.tiff'); + if (isDataFormat) { + processFile(file); + } else { + swapBackground(file); + } + } else { + processFile(file); + } uploadAnyInput.value = ''; });