Fix promise return

This commit is contained in:
SrGooglo 2025-05-15 14:11:20 +00:00
parent fe5cb1a9a2
commit 108d06f81a

View File

@ -17,7 +17,7 @@ export default class Files {
) )
} }
await new Promise((resolve, reject) => { const result = await new Promise((resolve, reject) => {
const uploadInstance = new FileUploadBrowser({ const uploadInstance = new FileUploadBrowser({
endpoint: Files.chunkUploadEndpoint, endpoint: Files.chunkUploadEndpoint,
splitChunkSize: 5 * 1024 * 1024, splitChunkSize: 5 * 1024 * 1024,
@ -49,10 +49,14 @@ export default class Files {
uploadInstance.start() uploadInstance.start()
}) })
return result
} catch (error) { } catch (error) {
if (typeof onError === "function") { if (typeof onError === "function") {
onError(file, error) onError(file, error)
} }
return null
} }
} }
} }