FIX: Do not error mobile upload button if !allowUpload (#14317)

allowUpload can be false for the composer if there are no
allowed file extensions. This causes the _bindMobileUploadButton
code to fail because the button does not get rendered in the
template if !allowUpload. This commit changes composer-editor
to only bind upload functionality if allowUpload.
This commit is contained in:
Martin Brennan 2021-09-13 09:16:03 +10:00 committed by GitHub
parent 4e0a43f211
commit f3273bd43e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -237,8 +237,10 @@ export default Component.extend(ComposerUpload, {
putCursorAtEnd(this.element.querySelector(".d-editor-input"));
}
this._bindUploadTarget();
this._bindMobileUploadButton();
if (this.allowUpload) {
this._bindUploadTarget();
this._bindMobileUploadButton();
}
this.appEvents.trigger("composer:will-open");
},