Discourse Comments

I’m using the Discourse Comment integration and trying to I’m getting a bug where even before the article is published it creates a post on the forum.

This is the snippet of code I’ve added to my template.

          <div id='discourse-comments'></div>

          <script type="text/javascript">
            DiscourseEmbed = { discourseUrl: 'https://forum.geekbeacon.org/',
                               discourseEmbedUrl: '{{url absolute="true"}}' };

            (function() {
              var d = document.createElement('script'); d.type = 'text/javascript'; d.async = true;
              d.src = DiscourseEmbed.discourseUrl + 'javascripts/embed.js';
              (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(d);

As soon as I preview a post, it will get created.

The content of the post now that I look it again is pretty random but you can see the unpublished post here and the forum post that goes with it is here

Any suggestions? Ideally the post should only be created when the post is actually published.

Sorry disregard this. The answer can be found here