diff --git a/internal_packages/attachments/stylesheets/attachments.less b/internal_packages/attachments/stylesheets/attachments.less index 07c677bc0..5476722fb 100644 --- a/internal_packages/attachments/stylesheets/attachments.less +++ b/internal_packages/attachments/stylesheets/attachments.less @@ -61,6 +61,8 @@ display: block; background: @progress-bar-fill; border-bottom-left-radius:4px; + transition: width .3s linear; + } .progress-background { position: absolute; diff --git a/src/flux/stores/file-upload-store.coffee b/src/flux/stores/file-upload-store.coffee index 47133fc75..9bd3df920 100644 --- a/src/flux/stores/file-upload-store.coffee +++ b/src/flux/stores/file-upload-store.coffee @@ -80,7 +80,14 @@ FileUploadStore = Reflux.createStore # state - one of "pending" "started" "progress" "completed" "aborted" "failed" _onUploadStateChanged: (uploadData) -> @_fileUploads[uploadData.uploadTaskId] = uploadData - @trigger() + @_fileUploadTrigger ?= _.throttle => + @trigger() + , 250 + + # Note: We throttle file upload updates, because they cause a significant refresh + # of the composer and when many uploads are running there can be a ton of state + # changes firing. (To test: drag and drop 20 files onto composer, watch performance.) + @_fileUploadTrigger() _onAbortUpload: (uploadData) -> Actions.dequeueMatchingTask