File tree 2 files changed +2
-11
lines changed 2 files changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ const loadFile = async (fileSrc: FileSrcType)
139
139
let fileData : Uint8Array ;
140
140
if ( "string" === typeof fileSrc ) {
141
141
fileName = getBasenameFromUrlOrDefault ( fileSrc ) ;
142
- fileData = await getUint8ArrayFrom ( fileSrc , ( ) => null ) ;
142
+ fileData = await getUint8ArrayFrom ( fileSrc ) ;
143
143
} else {
144
144
fileName = fileSrc . name ;
145
145
fileData = new Uint8Array ( await fileSrc . arrayBuffer ( ) ) ;
Original file line number Diff line number Diff line change 1
1
import axios , { AxiosError } from "axios" ;
2
2
3
3
4
- type ProgressCallback = ( numBytesDownloaded :number , numBytesTotal :number ) => void ;
5
-
6
4
/**
7
5
* Converts an Axios error into a custom Error object.
8
6
*
@@ -36,21 +34,14 @@ const convertAxiosError = (e: AxiosError): Error => {
36
34
* Downloads (bypassing any caching) a file as a Uint8Array.
37
35
*
38
36
* @param fileUrl
39
- * @param progressCallback
40
37
* @return The file's content.
41
38
* @throws {Error } if the download fails.
42
39
*/
43
- const getUint8ArrayFrom = async ( fileUrl : string , progressCallback : ProgressCallback )
40
+ const getUint8ArrayFrom = async ( fileUrl : string )
44
41
: Promise < Uint8Array > => {
45
42
try {
46
43
const { data} = await axios . get < ArrayBuffer > ( fileUrl , {
47
44
responseType : "arraybuffer" ,
48
- onDownloadProgress : ( { loaded, total} ) => {
49
- if ( "undefined" === typeof total ) {
50
- total = loaded ;
51
- }
52
- progressCallback ( loaded , total ) ;
53
- } ,
54
45
headers : {
55
46
"Cache-Control" : "no-cache" ,
56
47
"Pragma" : "no-cache" ,
You can’t perform that action at this time.
0 commit comments