fix: upload manager — URL imports, active count, board reset

1. URL imports now participate in upload manager pipeline:
   addUrlJob() creates a job row, uploadComplete/setFailed called
   on success/failure — consistent with local file uploads

2. activeCount only counts uploading/processing jobs, not failed.
   Failed jobs no longer inflate the "Uploads (n)" header count.

3. uploadManager.clear() called on boardId change so stale jobs
   from a previous board don't linger in the next board's panel.
This commit is contained in:
Hiren Kangad
2026-03-10 19:10:14 +05:30
parent 784554e40d
commit c126885e53
3 changed files with 39 additions and 3 deletions
+5
View File
@@ -64,6 +64,11 @@ export default function Editor({ isPublicView }: EditorProps) {
const canvasContainerRef = useRef<HTMLDivElement>(null);
const [uploadManager] = useState(() => new UploadManager());
// Reset upload manager when switching boards
useEffect(() => {
uploadManager.clear();
}, [boardId, uploadManager]);
// UI state
const [activeTool, setActiveTool] = useState<ToolType>(ToolType.SELECT);
const [color, setColor] = useState('#ffffff');