Comments (13)
@watawep23 It appears that the following function in the CommentCount
component might not be keeping the count updated like it's supposed to.
const queueResetCount = debounce(() => {
if (window.DISQUSWIDGETS)
window.DISQUSWIDGETS.getCount({ reset: true });
}, 300, false); // eslint-disable-line no-magic-numbers
I've labelled this as a bug and will work on finding a solution.
from disqus-react.
I looked deeper into this issue and it appears that the issue is that the count.js
script that the CommentCount
component relies on is not intended to update in realtime and can have a delay of up to 10 minutes.
Nonetheless, I'm going to investigate potential options for providing more responsive comment count data, so I'm going to label this as an enhancement rather than a bug for now.
from disqus-react.
It seems like there's a delay on updating the current comment count. Do you know how to fix that?
from disqus-react.
@watawep23 Could you provide the steps to reproduce this issue?
from disqus-react.
Hello, actually there are no steps to reproduce this issue, as soon as i load my post it shows no comment count for about 20 minutes or less.
My code looks like this:
const Post = (props) => {
const {title, content, createdAt, imageUrl, userId: {name}, _id} = props.details;
const newImgUrl = imageUrl.replace('\\', '/'); // replacing the \ in imageUrl to prevent questionmark in backgroundimage url
const imgSrc = `${baseUrl()}/${newImgUrl}`;
let preview = stripHTML(content).substr(0, DEFAULT_STR_LENGTH);
if (stripHTML(content).length > DEFAULT_STR_LENGTH) {
preview += '...';
}
const disqusShortname = '*****';
const disqusConfig = {
url: window.location.href,
identifier: _id,
title: title,
};
return (
<article className={classes.Post}>
<div className={classes.Post__date}>
<p className={classes.Post__date_m}>{moment(createdAt).format('MMMM')}</p>
<p className={classes.Post__date_y}>{moment(createdAt).format('YYYY')}</p>
<p className={classes.Post__date_d}>{moment(createdAt).format('D')}</p>
</div>
<Link to={`/post/${slugify(title, {lower: true})}`} className={classes.Post__banner_link}>
<div className={classes.Post__banner} style={{backgroundImage: `url(${imgSrc})`}}></div>
</Link>
<div className={classes.Post__content}>
<h1 className={classes.Post__title}>
<Link to={`/post/${slugify(title, {lower: true})}`}>{title}</Link>
</h1>
<ul className={classes.Post__meta}>
<li>By: <strong>{name}</strong></li>
<li>
<Disqus.CommentCount shortname={disqusShortname} config={disqusConfig}>
Comments
</Disqus.CommentCount>
</li>
</ul>
<p className={classes.Post__preview}>{preview}</p>
</div>
</article>
);
}
I'm using Create React App.
from disqus-react.
@watawep23 Thanks for info. I'll look into this tomorrow and see if I'm able to reproduce the issue and find a potential solution.
from disqus-react.
@tterb Noted. Thank you for your help.
from disqus-react.
Hi! The comment count still seems inaccurate, is there any updates on this? Should this issue still be open if it's not fixed?
from disqus-react.
@positimo As I mentioned above, the count.js
script that the CommentCount
component relies on is heavily cached within the Disqus service.
At this time there isn't an alternative way of retrieving a real-time comment count, but I have shared this concern with the team internally.
from disqus-react.
Right, OK, I was just surprised to not find this issue immediately although it's still pending..
from disqus-react.
Hi :)
Just wanted to know if we have any news on this or if is still an issue. On my side, it is not working properly and I don't know if this is still a bug or if I'm doing something wrong. Thanks
from disqus-react.
Yep, also an issue here. Comment counters not updating, calling
DISQUSWIDGETS.getCount({ reset: true })
has no effect.
from disqus-react.
same issue 😔
from disqus-react.
Related Issues (20)
- How do I get the image to load in the preview part of the Disqus homepage? HOT 2
- React 18 Support HOT 3
- Got a bunch of error when using disquss with Nextjs also got a CORS HOT 3
- No new release after react 18 upgrade? HOT 1
- Add new language
- Code failing in production (NextJS)
- Color Scheme / Theme Not Working HOT 1
- Does this React component not support SSO feature? HOT 5
- Tree shaking - bundle size HOT 1
- A11y failures meaning my website isn't WCAG AA
- Broken link to register if the shortname is incorrect
- Document how to disable reactions
- TypeError: Super expression must either be null or a function HOT 5
- Add theme prop to switch between light and dark mode HOT 1
- No Callbacks Running
- Dark Mode (Tailwind) not working HOT 5
- May `DiscussionEmbedConfig` type need `remoteAuthS3` field?
- CommentCount.js:125 Uncaught TypeError: Cannot read properties of undefined (reading 'string')
- Uncaught Error with parseColor using OKLCH color format in Next.js HOT 4
- Error: Super expression must either be null or a function HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from disqus-react.