fix: show extract API errors in UI instead of false 'Extraction complete'

doExtract() only checked data.message, so JSON responses with
error key (e.g. 'no ISO files found') would show green success.
Now checks data.error first and displays it in red.
This commit is contained in:
2026-06-22 01:10:40 -07:00
parent fe3e92ce33
commit d7a17eb054
+5
View File
@@ -175,6 +175,11 @@ async function doExtract() {
try {
const resp = await fetch(`${API}/extract?dir=${encodeURIComponent(isoDir)}&out=${encodeURIComponent(wavDir)}`);
const data = await resp.json();
if (data.error) {
status.textContent = data.error;
status.style.color = 'var(--accent)';
return;
}
status.textContent = data.message || 'Extraction complete';
status.style.color = 'var(--green)';
} catch (e) {