-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
url and identifier not making a difference, all comment boxes are the same #83
Comments
I solved it, and it doesn't really make sense why. Looks like a disqus problem: This does not work:
But this does:
All I did was add "_0" to the end of the identifier and now it works. This doesn't make any sense to me. |
@allthetime Do you have an example repo that I can use to reproduce this issue? |
I had this same problem but with reactions (didn't have any comments yet)--adding a reaction on one page added it to all pages. I added the fix from @allthetime and now it works. It's kind of strange because before that fix I was setting the identifier as either My code, without the fix, was exactly as is below, except for the shortName, obviously.
|
Having the same issue and the "solution" isn't working for me. |
This is a common issue and is usually an indication of a problem with the individual implementation, but I'm unable to help troubleshoot the issue without a sample repository to reproduce the issue. @squillen If the reactions are being shared across multiple pages then the comment threads would have the same issue. From the snippet you provided, I would advise you to try using your production URL as mentioned in the FAQ and seeing if that resolves your issue. |
Clue: |
I had the same problem using the DiscussionEmbed example. The fix mentioned earlier didn't work, but I was able to get it working by using setState and useEffect, and a loading prop.
|
tl;dr: Ran into something similar. My solution was to replace all dashes in the identifier with an underscore, then it magically worked. const disqusPostId = postId.split('-').join('_'); On my page, different comment threads are loaded without refreshing/navigating (I am still providing a unique URL for each Disqus thread). So I also give the containing <div key={`disqus-container-${disqusPostId}`}>
<DiscussionEmbed ... />
</div> Ensuring each thread had a unique key was not enough. Replacing Browsed the following Disqus resources, I don't see anything about dashes being illegal. In fact one of the examples shown in the docs actually HAS dashes. But for whatever reason, replacing the dashes in my identifier with underscores seems to "fix" it. |
Still the same issue in 2023.
|
Adding _0 seems to be working for me, my identifier was a string with underscores. |
On my page, I render a list of posts with a "SHOW COMMENTS" button that reveals the
DiscussionEmbed
element:here is the
showComments
function, which fires when the button is pressed, reset DISQUS from its window object and setscurrentPost
which then shows theDiscussionEmbed
component that matches:Anyway, all the comment blocks are the same / have the same comments. If I click the links to the comments contained in they have:
MY_URL
instead of
`MY_URL#!filename
What am I doing wrong?
The text was updated successfully, but these errors were encountered: