Giter Site home page Giter Site logo

Comments (14)

tterb avatar tterb commented on June 13, 2024 1

@hsluoyz Is that a thread that you've already updated the URL for using the URL Mapper I mentioned earlier?
Also, could you provide a link to a newly created thread where you're seeing the issue?

from disqus-react.

tterb avatar tterb commented on June 13, 2024

@Oyyko This functionality is provided by the primary Disqus application and is outside the scope of this repo, but I have reproduced the issue and brought it to the team so we will try to get a fix out ASAP.

from disqus-react.

tterb avatar tterb commented on June 13, 2024

@Oyyko In the meantime, it looks like the share-links can be fixed by the site-owner by removing the backslash from the end of the Website URL at https://crystal-lang.disqus.com/admin/settings/general/

from disqus-react.

Oyyko avatar Oyyko commented on June 13, 2024

Thanks for your attention. However, I tried to remove the backslash but it seems that nothing happened. Really a strange bug.

from disqus-react.

lacardonap avatar lacardonap commented on June 13, 2024

I don't know if this is the right place, but I want to share a gif that shows how leaving two slashes in on the main page causes the page to reload infinitely.

Tested:
Google Chrome Version 89.0.4389.90 (Official Build) (64-bit)
Mozilla Firefox Version 87.0 (64-bit)
infi_reload_page

from disqus-react.

hsluoyz avatar hsluoyz commented on June 13, 2024

@Oyyko In the meantime, it looks like the share-links can be fixed by the site-owner by removing the backslash from the end of the Website URL at https://crystal-lang.disqus.com/admin/settings/general/

@tterb our URL was already without ending slash

image

from disqus-react.

hsluoyz avatar hsluoyz commented on June 13, 2024

Hi @tterb , any update on the double slashes issue?

from disqus-react.

tterb avatar tterb commented on June 13, 2024

@hsluoyz @Oyyko A member of our support team investigated this issue and found that the reason for the double-slashes in URLs is a result of the url that is being set in the disqus_config containing double-slashes.

You can fix the issue on existing threads by updating the thread URLs using the URL Mapper and prevent the issue from occurring on new threads by ensuring the correct URL is being set in your disqus_config.

from disqus-react.

hsluoyz avatar hsluoyz commented on June 13, 2024

Hi @tterb , thanks for your reply! About this part:

prevent the issue from occurring on new threads by ensuring the correct URL is being set in your disqus_config.

I think we don't have double slashes in our config: https://github.com/casbin/casbin-website/blob/master/website/static/js/disqus.js But it's still happening on new threads. Why?

const PAGE_IDENTIFIER = window.location.pathname;
const BASE_URL = 'https://casbin.org';
const PAGE_URL = BASE_URL + PAGE_IDENTIFIER;

/**
 *  LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables
 */
var disqus_config = function() {
  this.page.url = PAGE_URL; // Page's canonical URL variable
  this.page.identifier = PAGE_IDENTIFIER; // Page's unique identifier variable
};

function loadDisqus() {
  (function() {
    // DON'T EDIT BELOW THIS LINE
    s = document.createElement('script');
    s.src = 'https://casbin.disqus.com/embed.js';
    s.setAttribute('data-timestamp', +new Date());
    (document.head || document.body).appendChild(s);
  })();
}

function maybeLoadDisqus() {
  const hr = document.createElement('hr');
  const disqusContainer = document.createElement('disqus');
  disqusContainer.id = 'disqus_thread';
  const postContainer = document.querySelectorAll('.post article')[0];
  const isDocsPage = PAGE_IDENTIFIER.indexOf('/docs') !== -1;
  if (postContainer && isDocsPage) {
    postContainer.appendChild(hr);
    postContainer.appendChild(disqusContainer);
    loadDisqus();
  }
  // editor page
  if (PAGE_IDENTIFIER.indexOf('/editor') !== -1) {
    var el = document.getElementById('disqus');
    el.appendChild(hr);
    el.appendChild(disqusContainer);
    loadDisqus();
  }
}

document.addEventListener('DOMContentLoaded', function() {
  maybeLoadDisqus();
});

@ErikQQY can you take over this issue?

from disqus-react.

ErikQQY avatar ErikQQY commented on June 13, 2024

@hsluoyz I am trying to solve this issue

from disqus-react.

tterb avatar tterb commented on June 13, 2024

I don't see an issue in the above code snippet that would cause new threads to have double backslashes in the URL and I'm not seeing any incorrectly formatted URLs at https://casbin.disqus.com/admin/discussions/.

Though, I did find the issue in crystal-lang.org here as the page.url begins with backslash.

from disqus-react.

hsluoyz avatar hsluoyz commented on June 13, 2024

@tterb but for this page: https://casbin.disqus.com/admin/moderate/approved , you can see the double slashes here:

image

from disqus-react.

ErikQQY avatar ErikQQY commented on June 13, 2024

@tterb Thanks for your help, I have already updated the URL using URL Mapper, the issue is now solved.

Besides, when I use the URL Mapper, the csv file containing comments doesn't covers all of our comments, so I have to edit some links directly in admin portal.

from disqus-react.

hsluoyz avatar hsluoyz commented on June 13, 2024

@tterb thanks for the help! I confirmed that the issue has been fixed. Feel free to close this issue :)

from disqus-react.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.