Skip to content

Commit 3067bd3

Browse files
committed
优化进度反馈
1 parent d45d313 commit 3067bd3

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

sdk/util.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,6 @@ var throttleOnProgress = function (total, onProgress) {
409409
var time0 = Date.now();
410410
var time1;
411411
var timer;
412-
var preInfo = {};
413412
function update() {
414413
timer = 0;
415414
if (onProgress && (typeof onProgress === 'function')) {
@@ -424,14 +423,7 @@ var throttleOnProgress = function (total, onProgress) {
424423
time0 = time1;
425424
size0 = size1;
426425
try {
427-
var curInfo = {loaded: size1, total: total, speed: speed, percent: percent};
428-
if (curInfo.loaded !== preInfo.loaded ||
429-
curInfo.total !== preInfo.total ||
430-
curInfo.speed !== preInfo.speed ||
431-
curInfo.percent !== preInfo.percent) {
432-
onProgress(curInfo);
433-
}
434-
preInfo = curInfo;
426+
onProgress({loaded: size1, total: total, speed: speed, percent: percent});
435427
} catch (e) {
436428
}
437429
}

0 commit comments

Comments
 (0)