<commit_before>/* eslint-disable camelcase */
/* global DISQUS */
export function loadComments(path) {
    if (__DOM__) {
        if (__DEV__) {
            window.disqus_developer = 1;
        }
        const domain = "http://www.prasannavl.com";
        let canonicalPath = domain + "/" + path;
        if (!window.disqus_config) {
            window.disqus_config = function () {
                this.page.url = canonicalPath;
                this.page.identifier = canonicalPath;
            };
            (function () {
                var d = document,
                    s = d.createElement('script');
                s.src = '//prasannavl.disqus.com/embed.js';
                s.setAttribute('data-timestamp', +new Date());
                (d.head || d.body).appendChild(s);
            })();
        } else {
            DISQUS.reset({
                reload: true,
                config: () => {
                    this.page.identifier = canonicalPath;
                    this.page.url = canonicalPath;
                }
            });
        }
    }
}<commit_msg>fix disqus comment reset: wrong function context<commit_after>/* eslint-disable camelcase */
/* global DISQUS */
export function loadComments(path) {
    if (__DOM__) {
        if (__DEV__) {
            window.disqus_developer = 1;
        }
        const domain = "http://www.prasannavl.com";
        let canonicalPath = domain + "/" + path;
        if (!window.disqus_config) {
            window.disqus_config = function () {
                this.page.url = canonicalPath;
                this.page.identifier = canonicalPath;
            };
            console.log("set: " + canonicalPath);            
            (function () {
                var d = document,
                    s = d.createElement('script');
                s.src = '//prasannavl.disqus.com/embed.js';
                s.setAttribute('data-timestamp', +new Date());
                (d.head || d.body).appendChild(s);
            })();
        } else {
            console.log("reset: " + canonicalPath);
            DISQUS.reset({
                reload: true,
                config: function () {
                    this.page.identifier = canonicalPath;
                    this.page.url = canonicalPath;
                }
            });
        }
    }
}
{'fraction_non_alphanumeric': 0.12645662494605092, 'fraction_numerical': 0.0008631851532153647, 'mean_word_length': 1.3064676616915423, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7359536', 'n_tokens_mistral': 641, 'n_tokens_neox': 607, 'n_words': 113}