DEV: prevents uppy to act on destroyed object (#14224)

This commit is contained in:
Joffrey JAFFEUX 2021-09-02 18:38:36 +02:00 committed by GitHub
parent d2eef423c3
commit 8bb331e63f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 0 deletions

View File

@ -147,6 +147,10 @@ export default Mixin.create({
}); });
this._uppyInstance.on("progress", (progress) => { this._uppyInstance.on("progress", (progress) => {
if (this.isDestroying || this.isDestroyed) {
return;
}
this.set("uploadProgress", progress); this.set("uploadProgress", progress);
}); });

View File

@ -103,6 +103,10 @@ export default Mixin.create({
}); });
$upload.on("fileuploadprogressall", (e, data) => { $upload.on("fileuploadprogressall", (e, data) => {
if (this.isDestroying || this.isDestroyed) {
return;
}
const progress = parseInt((data.loaded / data.total) * 100, 10); const progress = parseInt((data.loaded / data.total) * 100, 10);
this.set("uploadProgress", progress); this.set("uploadProgress", progress);
}); });

View File

@ -128,6 +128,10 @@ export default Mixin.create({
this._uppyInstance.use(UppyChecksum, { capabilities: this.capabilities }); this._uppyInstance.use(UppyChecksum, { capabilities: this.capabilities });
this._uppyInstance.on("progress", (progress) => { this._uppyInstance.on("progress", (progress) => {
if (this.isDestroying || this.isDestroyed) {
return;
}
this.set("uploadProgress", progress); this.set("uploadProgress", progress);
}); });