fix(frontend): resolve TS syntax errors from upload cancellation feature
Some checks failed
Automated Container Build / build-and-push (push) Failing after 15s

This commit is contained in:
Elijah 2026-05-23 17:55:40 -07:00
parent 91fc088389
commit bf9db781dc
2 changed files with 3 additions and 3 deletions

View file

@ -902,14 +902,14 @@ export default function FileExplorer({ onLogout }: FileExplorerProps) {
const totalBytes = entries.reduce((acc, curr) => acc + curr.file.size, 0); const totalBytes = entries.reduce((acc, curr) => acc + curr.file.size, 0);
const batchName = totalFiles === 1 ? entries[0].file.name : `Uploading ${totalFiles} items`; const batchName = totalFiles === 1 ? entries[0].file.name : `Uploading ${totalFiles} items`;
setUploads(prev => [...prev, { const newBatch: UploadBatch = {
id: batchId, id: batchId,
name: batchName, name: batchName,
totalBytes, totalBytes,
uploadedBytes: 0, uploadedBytes: 0,
totalFiles, totalFiles,
filesUploaded: 0, filesUploaded: 0,
status: 'uploading' as const, status: 'uploading',
abortController: new AbortController() abortController: new AbortController()
}; };

View file

@ -240,7 +240,7 @@ class ApiClient {
return res.json(); return res.json();
} }
upload(file: File, destPath: string, options?: { onProgress?: (percent: number) => void, overwrite?: boolean }): Promise<void> { upload(file: File, destPath: string, options?: { onProgress?: (percent: number) => void, overwrite?: boolean, signal?: AbortSignal }): Promise<void> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const upload = new tus.Upload(file, { const upload = new tus.Upload(file, {
endpoint: `${API_BASE}/api/tus/`, endpoint: `${API_BASE}/api/tus/`,