mirror of
https://github.com/discourse/discourse.git
synced 2025-02-27 16:06:10 +00: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.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
|
||||
_handleUploadError(file, error, response) {
|
||||
this._removeInProgressUpload(file.id);
|
||||
|
@ -224,8 +224,15 @@ export default Mixin.create(UppyS3Multipart, {
|
||||
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() {
|
||||
if (!this.filesAwaitingUpload) {
|
||||
return;
|
||||
@ -233,6 +240,7 @@ export default Mixin.create(UppyS3Multipart, {
|
||||
if (!this._uppyInstance?.getFiles().length) {
|
||||
return;
|
||||
}
|
||||
this.set("uploading", true);
|
||||
return this._uppyInstance?.upload();
|
||||
},
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user