From bf9db781dcfd7ed3b470f0fb3a2537924fef3ab3 Mon Sep 17 00:00:00 2001 From: Elijah Date: Sat, 23 May 2026 17:55:40 -0700 Subject: [PATCH] fix(frontend): resolve TS syntax errors from upload cancellation feature --- frontend/src/components/FileExplorer.tsx | 4 ++-- frontend/src/lib/api.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/FileExplorer.tsx b/frontend/src/components/FileExplorer.tsx index 6b372a0..7ae16a8 100644 --- a/frontend/src/components/FileExplorer.tsx +++ b/frontend/src/components/FileExplorer.tsx @@ -902,14 +902,14 @@ export default function FileExplorer({ onLogout }: FileExplorerProps) { const totalBytes = entries.reduce((acc, curr) => acc + curr.file.size, 0); const batchName = totalFiles === 1 ? entries[0].file.name : `Uploading ${totalFiles} items`; - setUploads(prev => [...prev, { + const newBatch: UploadBatch = { id: batchId, name: batchName, totalBytes, uploadedBytes: 0, totalFiles, filesUploaded: 0, - status: 'uploading' as const, + status: 'uploading', abortController: new AbortController() }; diff --git a/frontend/src/lib/api.ts b/frontend/src/lib/api.ts index 91c72a7..eef78d2 100644 --- a/frontend/src/lib/api.ts +++ b/frontend/src/lib/api.ts @@ -240,7 +240,7 @@ class ApiClient { return res.json(); } - upload(file: File, destPath: string, options?: { onProgress?: (percent: number) => void, overwrite?: boolean }): Promise { + upload(file: File, destPath: string, options?: { onProgress?: (percent: number) => void, overwrite?: boolean, signal?: AbortSignal }): Promise { return new Promise((resolve, reject) => { const upload = new tus.Upload(file, { endpoint: `${API_BASE}/api/tus/`,