mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 01:47:22 +08:00
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:
parent
4e0a43f211
commit
f3273bd43e
|
@ -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");
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user