mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Add uppyReady hook to uppy mixins (#15361)
This should be overridden in a child component if you need to hook into uppy events and be sure that everything is already set up for _uppyInstance.
This commit is contained in:
parent
2d68e5d942
commit
1cdb5b7e4a
@ -337,8 +337,14 @@ export default Mixin.create(ExtendableUploader, UppyS3Multipart, {
|
|||||||
this._setupUIPlugins();
|
this._setupUIPlugins();
|
||||||
|
|
||||||
this.uploadTargetBound = true;
|
this.uploadTargetBound = true;
|
||||||
|
this._uppyReady();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// This should be overridden in a child component if you need to
|
||||||
|
// hook into uppy events and be sure that everything is already
|
||||||
|
// set up for _uppyInstance.
|
||||||
|
_uppyReady() {},
|
||||||
|
|
||||||
@bind
|
@bind
|
||||||
_handleUploadError(file, error, response) {
|
_handleUploadError(file, error, response) {
|
||||||
this._removeInProgressUpload(file.id);
|
this._removeInProgressUpload(file.id);
|
||||||
|
@ -224,8 +224,15 @@ export default Mixin.create(UppyS3Multipart, {
|
|||||||
this._useXHRUploads();
|
this._useXHRUploads();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this._uppyReady();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// This should be overridden in a child component if you need to
|
||||||
|
// hook into uppy events and be sure that everything is already
|
||||||
|
// set up for _uppyInstance.
|
||||||
|
_uppyReady() {},
|
||||||
|
|
||||||
_startUpload() {
|
_startUpload() {
|
||||||
if (!this.filesAwaitingUpload) {
|
if (!this.filesAwaitingUpload) {
|
||||||
return;
|
return;
|
||||||
@ -233,6 +240,7 @@ export default Mixin.create(UppyS3Multipart, {
|
|||||||
if (!this._uppyInstance?.getFiles().length) {
|
if (!this._uppyInstance?.getFiles().length) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.set("uploading", true);
|
||||||
return this._uppyInstance?.upload();
|
return this._uppyInstance?.upload();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user