@uppy/core
Advanced tools
Comparing version 1.16.0 to 1.16.1
@@ -1742,4 +1742,21 @@ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
return; | ||
} | ||
} // Mark postprocessing step as complete if necessary; this addresses a case where we might get | ||
// stuck in the postprocessing UI while the upload is fully complete. | ||
// If the postprocessing steps do not do any work, they may not emit postprocessing events at | ||
// all, and never mark the postprocessing as complete. This is fine on its own but we | ||
// introduced code in the @uppy/core upload-success handler to prepare postprocessing progress | ||
// state if any postprocessors are registered. That is to avoid a "flash of completed state" | ||
// before the postprocessing plugins can emit events. | ||
// | ||
// So, just in case an upload with postprocessing plugins *has* completed *without* emitting | ||
// postprocessing completion, we do it instead. | ||
currentUpload.fileIDs.forEach(function (fileID) { | ||
var file = _this9.getFile(fileID); | ||
if (file && file.progress.postprocess) { | ||
_this9.emit('postprocess-complete', file); | ||
} | ||
}); | ||
var files = currentUpload.fileIDs.map(function (fileID) { | ||
@@ -1860,3 +1877,3 @@ return _this9.getFile(fileID); | ||
Uppy.VERSION = "1.16.0"; | ||
Uppy.VERSION = "1.16.1"; | ||
@@ -1863,0 +1880,0 @@ module.exports = function (opts) { |
{ | ||
"name": "@uppy/core", | ||
"description": "Core module for the extensible JavaScript file upload widget with support for drag&drop, resumable uploads, previews, restrictions, file processing/encoding, remote providers like Instagram, Dropbox, Google Drive, S3 and more :dog:", | ||
"version": "1.16.0", | ||
"version": "1.16.1", | ||
"license": "MIT", | ||
@@ -25,3 +25,3 @@ "main": "lib/index.js", | ||
"@uppy/store-default": "^1.2.5", | ||
"@uppy/utils": "^3.4.0", | ||
"@uppy/utils": "^3.4.1", | ||
"cuid": "^2.1.1", | ||
@@ -33,3 +33,3 @@ "lodash.throttle": "^4.1.1", | ||
}, | ||
"gitHead": "7c55bd855e456c536bcd318efeefd65e774cd903" | ||
"gitHead": "2eabc3309983165b3f275c7b6f21fc0e899d11ba" | ||
} |
@@ -1184,6 +1184,11 @@ const Translator = require('@uppy/utils/lib/Translator') | ||
} | ||
const files = Object.assign({}, this.getState().files) | ||
files[file.id] = Object.assign({}, files[file.id], { | ||
progress: Object.assign({}, files[file.id].progress) | ||
}) | ||
const files = { | ||
...this.getState().files | ||
} | ||
files[file.id] = { | ||
...files[file.id], | ||
progress: { | ||
...files[file.id].progress | ||
} | ||
} | ||
delete files[file.id].progress.postprocess | ||
@@ -1536,9 +1541,12 @@ // TODO should we set some kind of `fullyComplete` property on the file object | ||
const updatedUpload = Object.assign({}, currentUpload, { | ||
step: step | ||
}) | ||
const updatedUpload = { | ||
...currentUpload, | ||
step | ||
} | ||
this.setState({ | ||
currentUploads: Object.assign({}, currentUploads, { | ||
currentUploads: { | ||
...currentUploads, | ||
[uploadID]: updatedUpload | ||
}) | ||
} | ||
}) | ||
@@ -1569,4 +1577,20 @@ | ||
const files = currentUpload.fileIDs | ||
.map((fileID) => this.getFile(fileID)) | ||
// Mark postprocessing step as complete if necessary; this addresses a case where we might get | ||
// stuck in the postprocessing UI while the upload is fully complete. | ||
// If the postprocessing steps do not do any work, they may not emit postprocessing events at | ||
// all, and never mark the postprocessing as complete. This is fine on its own but we | ||
// introduced code in the @uppy/core upload-success handler to prepare postprocessing progress | ||
// state if any postprocessors are registered. That is to avoid a "flash of completed state" | ||
// before the postprocessing plugins can emit events. | ||
// | ||
// So, just in case an upload with postprocessing plugins *has* completed *without* emitting | ||
// postprocessing completion, we do it instead. | ||
currentUpload.fileIDs.forEach((fileID) => { | ||
const file = this.getFile(fileID) | ||
if (file && file.progress.postprocess) { | ||
this.emit('postprocess-complete', file) | ||
} | ||
}) | ||
const files = currentUpload.fileIDs.map((fileID) => this.getFile(fileID)) | ||
const successful = files.filter((file) => !file.error) | ||
@@ -1573,0 +1597,0 @@ const failed = files.filter((file) => file.error) |
Sorry, the diff of this file is not supported yet
339188
5836
Updated@uppy/utils@^3.4.1