glitch-javascript-sdk 0.7.9 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/src/util/Requests.ts +3 -3
package/package.json
CHANGED
package/src/util/Requests.ts
CHANGED
|
@@ -222,7 +222,7 @@ class Requests {
|
|
|
222
222
|
window.crypto.getRandomValues(array);
|
|
223
223
|
const identifier = Array.from(array, dec => ('0' + dec.toString(16)).substr(-2)).join('');
|
|
224
224
|
|
|
225
|
-
while (currentChunkIndex
|
|
225
|
+
while (currentChunkIndex <= totalChunks) {
|
|
226
226
|
const start = currentChunkIndex * chunkSize;
|
|
227
227
|
const end = Math.min(start + chunkSize, fileSize);
|
|
228
228
|
const chunk = file.slice(start, end);
|
|
@@ -255,10 +255,10 @@ class Requests {
|
|
|
255
255
|
onUploadProgress: (progressEvent) => {
|
|
256
256
|
const currentChunkProgress = progressEvent.loaded; // Bytes uploaded of the current chunk
|
|
257
257
|
// Calculate the total uploaded size including previous chunks and the current chunk's progress
|
|
258
|
-
|
|
258
|
+
totalUploaded += currentChunkProgress;
|
|
259
259
|
|
|
260
260
|
if(onProgress){
|
|
261
|
-
onProgress(fileSize,
|
|
261
|
+
onProgress(fileSize, totalUploaded);
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
264
|
});
|