Disable progress throttling in Core

It was supposed to be a part of https://github.com/transloadit/uppy/pull/864, don’t know how it got cut out, I must have discarded changes accidentaly or smth
This commit is contained in:
Artur Paikin 2018-05-31 17:24:41 -04:00
parent ec8e207ae5
commit fdcca95130

View file

@ -2,7 +2,7 @@ const Utils = require('../core/Utils')
const Translator = require('../core/Translator')
const ee = require('namespace-emitter')
const cuid = require('cuid')
const throttle = require('lodash.throttle')
// const throttle = require('lodash.throttle')
const prettyBytes = require('prettier-bytes')
const match = require('mime-match')
const DefaultStore = require('../store/DefaultStore')
@ -693,9 +693,9 @@ class Uppy {
// connection to the remote server. Therefore, we are throtteling them to
// prevent accessive function calls.
// see also: https://github.com/tus/tus-js-client/commit/9940f27b2361fd7e10ba58b09b60d82422183bbb
const _throttledCalculateProgress = throttle(this._calculateProgress, 100, { leading: true, trailing: true })
// const _throttledCalculateProgress = throttle(this._calculateProgress, 100, { leading: true, trailing: true })
this.on('upload-progress', _throttledCalculateProgress)
this.on('upload-progress', this._calculateProgress)
this.on('upload-success', (file, uploadResp, uploadURL) => {
const currentProgress = this.getFile(file.id).progress