FIX: Hide edit topic title button only on encrypted topics.

FIX: Hide edit topic title button only on encrypted topics.

diff --git a/assets/javascripts/discourse/initializers/hook-decrypt-topic.js.es6 b/assets/javascripts/discourse/initializers/hook-decrypt-topic.js.es6
index 25ac927..7a37e1a 100644
--- a/assets/javascripts/discourse/initializers/hook-decrypt-topic.js.es6
+++ b/assets/javascripts/discourse/initializers/hook-decrypt-topic.js.es6
@@ -49,6 +49,9 @@ function decryptElements(containerSelector, elementSelector, opts) {
         }
       })
       .catch(() => $(this).data("decrypted", null));
+
+      // TODO: Hide quick-edit button for the time being.
+      $(this).find(".edit-topic").hide();
   });
 }
 
@@ -67,9 +70,6 @@ export function decryptTitles() {
   decryptElements("a.topic-link[data-topic-id]", { addIcon: true });
   decryptElements("a.raw-topic-link[data-topic-id]", { addIcon: true });
   decryptElements(".notifications span[data-topic-id]");
-
-  // TODO: Hide quick-edit button for the time being.
-  $(".edit-topic").hide();
 }
 
 export default {

GitHub sha: 6a62baaf

2 Likes