FIX: Do not decrypt posts that have not been posted yet.

FIX: Do not decrypt posts that have not been posted yet.

diff --git a/assets/javascripts/discourse/initializers/hook-decrypt-post.js.es6 b/assets/javascripts/discourse/initializers/hook-decrypt-post.js.es6
index 6643def..f033604 100644
--- a/assets/javascripts/discourse/initializers/hook-decrypt-post.js.es6
+++ b/assets/javascripts/discourse/initializers/hook-decrypt-post.js.es6
@@ -164,7 +164,7 @@ export default {
       api.reopenWidget("post-contents", {
         html(attrs, state) {
           const topicId = attrs.topicId;
-          if (!hasTopicTitle(topicId)) {
+          if (attrs.id === -1 || !hasTopicTitle(topicId)) {
             return this._super(...arguments);
           }

GitHub sha: 525f92cb

1 Like