fix(frontend): resolve TS syntax errors from upload cancellation feature
Some checks failed
Automated Container Build / build-and-push (push) Failing after 15s
Some checks failed
Automated Container Build / build-and-push (push) Failing after 15s
This commit is contained in:
parent
91fc088389
commit
bf9db781dc
2 changed files with 3 additions and 3 deletions
|
|
@ -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()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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/`,
|
||||||
|
|
|
||||||
Reference in a new issue