fix: progress bar not showing during stitch processing

setError() in the file store unconditionally set processing to false,
even when called with null to clear a previous error. This meant
setProcessing(true) followed by setError(null) at the start of
processing would immediately kill the processing state, preventing the
progress bar from ever rendering.

Fix setError to only reset processing when there is an actual error.
This also fixes the same latent bug in 10+ other custom tool settings
components that call setProcessing before setError.
This commit is contained in:
SnapOtter
2026-05-13 11:04:35 +08:00
parent 5a487746d0
commit abfad0de56
2 changed files with 2 additions and 2 deletions
@@ -28,8 +28,8 @@ export function StitchSettings() {
const handleProcess = async () => {
if (files.length < 2) return;
setProcessing(true);
setError(null);
setProcessing(true);
setDownloadUrl(null);
setUploadProgress(0);
+1 -1
View File
@@ -269,7 +269,7 @@ export const useFileStore = create<FileState>((set, get) => ({
setProcessing: (v) => set({ processing: v }),
setError: (e) => set({ error: e, processing: false }),
setError: (e) => set(e ? { error: e, processing: false } : { error: null }),
setJobId: (_id) => {
// no-op for backward compat