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

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.

diff --git a/app/assets/javascripts/discourse/app/components/composer-editor.js b/app/assets/javascripts/discourse/app/components/composer-editor.js
index bc351f6..0a625f4 100644
--- a/app/assets/javascripts/discourse/app/components/composer-editor.js
+++ b/app/assets/javascripts/discourse/app/components/composer-editor.js
@@ -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");
   },

GitHub sha: f3273bd43ea1ea8bd9b83b88cf4ff40a8d0327f4

This commit appears in #14317 which was approved by lis2. It was merged by martin.