FIX: workaround as optional chaining is not transpiled yet (#64)

FIX: workaround as optional chaining is not transpiled yet (#64)

diff --git a/assets/javascripts/initializers/discourse-post-event-decorator.js.es6 b/assets/javascripts/initializers/discourse-post-event-decorator.js.es6
index 083271a..26bcdc5 100644
--- a/assets/javascripts/initializers/discourse-post-event-decorator.js.es6
+++ b/assets/javascripts/initializers/discourse-post-event-decorator.js.es6
@@ -195,7 +195,7 @@ function initializeDiscoursePostEventDecorator(api) {
       if (helper) {
         const post = helper.getModel();
 
-        if (post?.event) {
+        if (post && post.event) {
           _decorateEvent(api, cooked, post.event);
         }
       }

GitHub sha: 641d6c00

1 Like

This commit appears in #64 which was approved by davidtaylorhq. It was merged by jjaffeux.