DEV: Move composer controller lookup inside _useStableUploadProcessor (#139)

DEV: Move composer controller lookup inside _useStableUploadProcessor (#139)

This needs to be done becaus modifyClass calls are not allowed after lookup was called.

diff --git a/assets/javascripts/discourse/initializers/encrypt-uploads.js b/assets/javascripts/discourse/initializers/encrypt-uploads.js
index 448a6f7..8dcc361 100644
--- a/assets/javascripts/discourse/initializers/encrypt-uploads.js
+++ b/assets/javascripts/discourse/initializers/encrypt-uploads.js
@@ -34,8 +34,7 @@ export default {
       const uploads = {};
 
       if (!siteSettings.enable_experimental_composer_uploader) {
-        const controller = container.lookup("controller:composer");
-        this._useStableUploadProcessor(api, siteSettings, uploads, controller);
+        this._useStableUploadProcessor(api, siteSettings, uploads);
       } else {
         this._useExperimentalComposerUploadProcessor(
           api,
@@ -63,8 +62,9 @@ export default {
     });
   },
 
-  _useStableUploadProcessor(api, siteSettings, uploads, controller) {
+  _useStableUploadProcessor(api, siteSettings, uploads) {
     api.addComposerUploadHandler([".*"], (file, editor) => {
+      const controller = api.container.lookup("controller:composer");
       const topicId = controller.get("model.topic.id");
       if (!controller.get("model.isEncrypted") && !hasTopicKey(topicId)) {
         return true;

GitHub sha: efe2b80c7afdbf8eb729a20d394eeaceb0c96f7f

This commit appears in #139 which was approved by tgxworld. It was merged by martin.