fix: setError(null) was overriding setProcessing(true)

The Zustand setError() setter has a side effect: it sets
processing=false. When called after setProcessing(true), it
immediately killed the processing state, so the ProgressCard
never rendered. Fix: call setError(null) before setProcessing(true).
This commit is contained in:
Siddharth Kumar Sah
2026-03-23 09:32:45 +08:00
parent b3f590c8b3
commit b5cc452077
3 changed files with 3 additions and 3 deletions
@@ -28,9 +28,9 @@ export function EraseObjectSettings() {
const handleProcess = async () => {
if (files.length === 0 || !maskFile) return;
setProcessing(true);
setError(null);
setDownloadUrl(null);
setProcessing(true);
setProgressPhase("uploading");
setProgressPercent(0);
setProgressStage(undefined);
@@ -36,9 +36,9 @@ export function OcrSettings() {
const handleProcess = async () => {
if (files.length === 0) return;
setProcessing(true);
setError(null);
setText(null);
setProcessing(true);
setProgressPhase("uploading");
setProgressPercent(0);
setProgressStage(undefined);
+1 -1
View File
@@ -68,9 +68,9 @@ export function useToolProcessor(toolId: string) {
return;
}
setProcessing(true);
setError(null);
setProcessedUrl(null);
setProcessing(true);
setProgress({ phase: "uploading", percent: 0, elapsed: 0 });
// Start elapsed timer